/** * Reads a category out of the table in database selected by different columns in the table. * The columns are commited with an array where every element index is the column name and the value is the column value. * The columns and values must be selected so that they identify only one record. * If the sql will find more than one record the method returns @b false. * Per default all columns of adm_categories will be read and stored in the object. * @param array $columnArray An array where every element index is the column name and the value is the column value * @return bool Returns @b true if one record is found */ public function readDataByColumns($columnArray) { $returnValue = parent::readDataByColumns($columnArray); if ($returnValue) { switch ($this->getValue('cat_type')) { case 'ROL': $this->elementTable = TBL_ROLES; $this->elementColumn = 'rol_cat_id'; break; case 'LNK': $this->elementTable = TBL_LINKS; $this->elementColumn = 'lnk_cat_id'; break; case 'USF': $this->elementTable = TBL_USER_FIELDS; $this->elementColumn = 'usf_cat_id'; break; case 'DAT': $this->elementTable = TBL_DATES; $this->elementColumn = 'dat_cat_id'; break; } } return $returnValue; }
/** Reads a category out of the table in database selected by different columns in the table. * The columns are commited with an array where every element index is the column name and the value is the column value. * The columns and values must be selected so that they identify only one record. * If the sql will find more than one record the method returns @b false. * Per default all columns of adm_categories will be read and stored in the object. * @param $columnArray An array where every element index is the column name and the value is the column value * @return Returns @b true if one record is found */ public function readDataByColumns($columnArray) { $returnValue = parent::readDataByColumns($columnArray); if ($returnValue) { if ($this->getValue('cat_type') == 'ROL') { $this->elementTable = TBL_ROLES; $this->elementColumn = 'rol_cat_id'; } elseif ($this->getValue('cat_type') == 'LNK') { $this->elementTable = TBL_LINKS; $this->elementColumn = 'lnk_cat_id'; } elseif ($this->getValue('cat_type') == 'USF') { $this->elementTable = TBL_USER_FIELDS; $this->elementColumn = 'usf_cat_id'; } elseif ($this->getValue('cat_type') == 'DAT') { $this->elementTable = TBL_DATES; $this->elementColumn = 'dat_cat_id'; } } return $returnValue; }