示例#1
0
 /**
  * The function is similar to loadById(),
  * but doesn't get the parent path.
  * So this function uses less SQL statements and is faster.
  * Attention: Use the functions getPath(), getRelativePath()
  * and getHtmlPath() might not work correctly!
  * @param $id
  * @param $tablename
  * @param $fields
  * @return boolean Returns TRUE on success or FALSE on failure.
  */
 public function loadByIdWithoutPath($id, $tablename = '', $fields = '*')
 {
     return parent::loadById($id, $tablename, $fields);
 }
示例#2
0
 /**
  * Overwrite the function to load the item and
  * the language data.
  * @see API/MODELS/SF_MODEL_AbstractSqlItem#loadById($id, $tablename)
  */
 public function loadById($id, $tablename = '', $fields = '*')
 {
     $bool = TRUE;
     // only load this table, if the table contains the requested fields
     if (($tablename == '' || $tablename == $this->table_upl) && ($fields == '*' || $fields != '*' && $this->isFieldInTable($fields, $this->table_upl) == TRUE)) {
         $bool = parent::loadById($id, $this->table_upl, $fields);
         // on error, abort immediately
         if ($bool == FALSE) {
             return FALSE;
         }
     }
     // only load this table, if the table contains the requested fields
     if (($tablename == '' || $tablename == $this->table_upl_lang) && ($fields == '*' || $fields != '*' && $this->isFieldInTable($fields, $this->table_upl_lang) == TRUE)) {
         // $id = idupl -> it is corrected in _getLoadSql()
         $bool = parent::loadById($id, $this->table_upl_lang, $fields);
     }
     // load information about directory
     $this->filesystem['dirname'] = $this->_getDirnameByIddirectory($this->getField('iddirectory'));
     return $bool;
 }