コード例 #1
0
ファイル: KALS_actor.php プロジェクト: 119155012/kals
 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;
 }
コード例 #2
0
ファイル: Generic_collection.php プロジェクト: 119155012/kals
 /**
  * 設定合集內成員
  * @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;
 }
コード例 #3
0
 /**
  * 檢查單一約束
  * @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;
 }
コード例 #4
0
 /**
  * 刪除時,同時刪除檔案系統中的檔案
  */
 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();
 }