public function __construct($id = NULL) { parent::__construct($id); $this->_CI_load('library', 'kals_resource/Domain', 'domain'); $this->_CI_load('library', 'kals_actor/Group', 'group'); $this->_CI_load('library', 'kals_actor/User', 'user'); return $this; }
/** * 設定合集內成員 * @param integer|Generic_object|array|Generic_collection $coll * 可以輸入Generic_object的ID(int)、Generic_object本身、包含Generic_object的陣列(array)、或是Generic_collection * @return Generic_collection */ public function set_members($coll) { if (is_int($coll) && isset($this->index_object)) { $coll = $this->index_object->filter_object($coll); } if (is_class($coll, $this->class_name)) { $coll = array($coll); } $this->members = array(); foreach ($coll as $item) { $this->members[] = $item; } $this->modified = TRUE; $this->is_loaded = TRUE; return $this; }
/** * 檢查單一約束 * @param Generic_object $go * @return boolean */ protected static function _check_unique(Generic_object $go) { $pass = TRUE; $restriction = $go->unique_restriction; $where = array(); $full_data = TRUE; foreach ($restriction as $field) { $where[$field] = $go->get_field($field); if (is_null($where[$field])) { $full_data = FALSE; break; } } if (TRUE === $full_data && count($where) > 0) { $result_num = self::_get_result_num($go, $where); if ($result_num > 0) { $pass = FALSE; } } return $pass; }
/** * 刪除時,同時刪除檔案系統中的檔案 */ public function delete() { $this->delete_file(); if ($this->CI->config->item("reserve_original") === TRUE && $this->is_original() === FALSE && is_object($this->get_original_bitstream())) { $original_bitstream = $this->get_original_bitstream(); if ($original_bitstream->is_deleted() === FALSE) { $original_bitstream->delete(); } } parent::delete(); }