/** * Retrieves all values from the listed fieldnames in the $config_fields array * @param array $config_fields * @return array Returns the values as associative array as array('fieldname' => 'value', ...) */ protected function _getValues($config_fields) { foreach ($config_fields['fieldname'] as $fieldname) { $values[$fieldname] = $this->item->getField($fieldname); } return $values; }
/** * Constructor sets up the model with relevant tables and releated fields. */ public function __construct() { // call AbstractSqlItem constructor parent::__construct(); $this->table_code = $this->cfg->db('code'); // table directory $this->_addTable($this->table_code); $this->_addTableFields($this->table_code, array('idcatside' => '', 'code' => '', 'changed' => '1')); $this->_addDefaultFields($this->table_code); $this->_addRowMapping($this->table_code, array('id' => 'idcode')); $this->_addDisabledFields($this->table_code, array('idclient' => TRUE, 'created' => TRUE, 'created_author' => TRUE, 'lastmodified' => TRUE, 'lastmodified_author' => TRUE, 'ip' => TRUE, 'groupkey' => TRUE)); }
/** * Constructor sets up the model with relevant tables and releated fields. */ public function __construct() { // call AbstractSqlItem constructor parent::__construct(); $this->table_values = $this->cfg->db('values'); // table directory $this->_addTable($this->table_values); $this->_addTableFields($this->table_values, array('group_name' => '', 'description' => '', 'key1' => '', 'key2' => '', 'key3' => '', 'key4' => '', 'value' => '', 'conf_sortindex' => '', 'conf_desc_langstring' => '', 'conf_head_langstring' => '', 'conf_input_type' => '', 'conf_input_type_val' => '', 'conf_head_langstring' => '', 'conf_input_type_langstring' => '', 'conf_visible' => '')); $this->_addDefaultFields($this->table_values); $this->_addRowMapping($this->table_values, array('id' => 'idvalues')); $this->_addDisabledFields($this->table_values, array('created' => TRUE, 'created_author' => TRUE, 'lastmodified' => TRUE, 'lastmodified_author' => TRUE, 'ip' => TRUE, 'groupkey' => TRUE)); }
/** * Constructor sets up the model with relevant tables and releated fields. */ public function __construct() { // call AbstractSqlItem constructor parent::__construct(); $this->table_values = $this->cfg->db('event'); // table directory $this->_addTable($this->table_values); $this->_addTableFields($this->table_values, array('name' => '', 'code' => '', 'sortindex' => '', 'title' => '', 'description' => '', 'reference_type' => '', 'reference_id' => '', 'reference_name' => '')); $this->_addDefaultFields($this->table_values); $this->_addRowMapping($this->table_values, array('id' => 'idevent')); $this->_addDisabledFields($this->table_values, array('ip' => TRUE, 'groupkey' => TRUE)); }
/** * Constructor sets up the model with relevant tables and releated fields. */ public function __construct() { // call AbstractSqlItem constructor parent::__construct(); $this->table_filetype = $this->cfg->db('filetype'); // table directory $this->_addTable($this->table_filetype); $this->_addTableFields($this->table_filetype, array('filetype' => '', 'description' => '', 'filetypepict' => '', 'status' => '', 'filetypegroup' => '', 'mimetype' => '', 'addinfo_names' => '')); $this->_addDefaultFields($this->table_filetype); $this->_addRowMapping($this->table_filetype, array('id' => 'idfiletype')); $this->_addDisabledFields($this->table_filetype, array('idlang' => TRUE, 'ip' => TRUE, 'groupkey' => TRUE)); }
/** * Constructor sets up the model with relevant tables and releated fields. */ public function __construct() { // call AbstractSqlItem constructor parent::__construct(); // overwrite current_author with username and not id $this->itemcfg['current_author'] = $this->cfg->auth('uname'); $this->table_logs = $this->cfg->db('logs'); // set up table $this->_addTable($this->table_logs); $this->_addTableFields($this->table_logs, array('is_backend' => '', 'priority' => '', 'priorityname' => '', 'type' => '', 'message' => '')); $this->_addSerializedFields($this->table_logs, array('param' => '')); $this->_addDefaultFields($this->table_logs); $this->_addRowMapping($this->table_logs, array('id' => 'idlog')); $this->_addDisabledFields($this->table_logs, array('groupkey' => TRUE)); }
/** * Overwrite the creation of the delete SQL statement * to use the foreign key for deletion in language table. * @see API/MODELS/SF_MODEL_AbstractSqlItem#_getDeleteSql($tablename, $fields, $where, $foreignkey) */ protected function _getDeleteSql($tablename, $where, $foreignkey = '') { if ($tablename == $this->table_directory_lang) { $foreignkey = 'iddirectory'; } $sql = parent::_getDeleteSql($tablename, $where, $foreignkey); //echo $sql."<br />"; return $sql; }