/** * get objects * * @access public * @param object $criteria * @param bool $id_as_key * @param string $fieldlist fieldlist for distinct select * @param bool $distinct * @param XooNIpsJoinCriteria $joindef join criteria object * @return array objects */ function &getObjects($criteria = null, $id_as_key = false, $fieldlist = '', $distinct = false, $joindef = null) { if ($fieldlist == '') { $fieldlist = '*'; } $fieldlist .= ', unix_timestamp(' . $this->db->prefix($this->__table_name) . '.updated) as updated '; return parent::getObjects($criteria, $id_as_key, $fieldlist, $distinct, $joindef); }
/** * gets File objects join xoonips_file_type. * * @access public * @param object $criteria * @param bool $id_as_key * @param string $fieldlist fieldlist for distinct select * @param bool $distinct * @param XooNIpsJoinCriteria $joindef join criteria object * @return array objects */ function &getObjects($criteria = null, $id_as_key = false, $fieldlist = '', $distinct = false, $joindef = null) { if (is_null($joindef) || !(is_subclass_of($joindef, 'xoonipsjoincriteria') || strtolower(get_class($joindef)) == 'xoonipsjoincriteria')) { $joindef = new XooNIpsJoinCriteria('xoonips_file_type', 'file_type_id', 'file_type_id'); } else { $joindef->cascade(new XooNIpsJoinCriteria('xoonips_file_type', 'file_type_id', 'file_type_id'), 'xoonips_file'); } $table = $this->db->prefix('xoonips_file'); if (trim($fieldlist) == '') { $fieldlist = "{$table}.file_id, {$table}.item_id, {$table}.original_file_name, {$table}.mime_type, {$table}.file_name, {$table}.file_size, {$table}.thumbnail_file, {$table}.caption, {$table}.sess_id, {$table}.file_type_id, {$table}.search_module_name, {$table}.search_module_version, {$table}.header, {$table}.timestamp, {$table}.is_deleted, {$table}.download_count"; } $files = parent::getObjects($criteria, $id_as_key, $fieldlist, $distinct, $joindef); if ($files) { for ($i = 0; $i < count($files); $i++) { $files[$i]->setFilepath($this->createFilepath($files[$i])); } } return $files; }