|| ###################################################################
\*=====================================================================*/
-$GLOBALS['isso:callback']->load('api', null);
+require_once ISSO . '/Api.php';
require_once('./includes/functions_datastore.php');
* @package Bugdar
*
*/
-class StatusAPI extends API
+class StatusAPI extends BSApi
{
/**
- * Fields
- * @var array
- * @access private
- */
- var $fields = array(
- 'statusid' => array(TYPE_UINT, REQ_AUTO, 'verify_nozero'),
- 'status' => array(TYPE_STR, REQ_YES, 'verify_noempty'),
+ * Fields
+ * @var array
+ */
+ protected $fields = array(
+ 'statusid' => array(TYPE_UINT, REQ_AUTO),
+ 'status' => array(TYPE_STR, REQ_YES),
'color' => array(TYPE_STR, REQ_NO),
'displayorder' => array(TYPE_INT, REQ_NO)
);
/**
- * Database table
- * @var string
- * @access private
- */
- var $table = 'status';
+ * Database table
+ * @var string
+ */
+ protected $table = 'status';
/**
- * Table prefix
- * @var string
- * @access private
- */
- var $prefix = TABLE_PREFIX;
+ * Table prefix
+ * @var string
+ */
+ protected $prefix = TABLE_PREFIX;
- // ###################################################################
/**
- * Post-insert
- *
- * @access protected
- */
+ * Post-insert
+ */
function post_insert()
{
build_statuses();
}
- // ###################################################################
/**
- * Post-update
- *
- * @access protected
- */
- function post_update()
+ * Post-update
+ */
+ protected function post_update()
{
build_statuses();
}
- // ###################################################################
/**
- * Post-delete
- *
- * @access protected
- */
- function post_delete()
+ * Post-delete
+ */
+ protected function post_delete()
{
build_statuses();
- $this->registry->db->query("UPDATE " . TABLE_PREFIX . "bug SET status = " . bugdar::$options['defaultstatus'] . " WHERE status = " . $this->values['statusid']);
+ BSApp::$db->query("UPDATE " . TABLE_PREFIX . "bug SET status = " . bugdar::$options['defaultstatus'] . " WHERE status = " . $this->values['statusid']);
+ }
+
+ /**
+ * Validate: statusid
+ */
+ protected function validate_statusid($field)
+ {
+ return $this->_verifyIsNotZero($field);
+ }
+
+ /**
+ * Validate: status
+ */
+ protected function validate_status($field)
+ {
+ return $this->_verifyIsNotEmpty($field);
}
}