Ejemplo n.º 1
0
 /**
  * Reads a category out of the table in database selected by the unique category id in the table.
  * Per default all columns of adm_categories will be read and stored in the object.
  * @param int $cat_id Unique cat_id
  * @return bool Returns @b true if one record is found
  */
 public function readDataById($cat_id)
 {
     global $g_tbl_praefix;
     $returnValue = parent::readDataById($cat_id);
     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;
             case 'AWA':
                 $this->elementTable = $g_tbl_praefix . '_user_awards';
                 $this->elementColumn = 'awa_cat_id';
                 break;
         }
     }
     return $returnValue;
 }
Ejemplo n.º 2
0
 /** Reads a category out of the table in database selected by the unique category id in the table.
  *  Per default all columns of adm_categories will be read and stored in the object.
  *  @param $id Unique cat_id
  *  @return Returns @b true if one record is found
  */
 public function readDataById($cat_id)
 {
     $returnValue = parent::readDataById($cat_id);
     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;
 }