protected function _post_update()
 {
     parent::_post_update();
     if (isset($this->index_object)) {
         $members = $this->_pre_update($this->members);
         foreach ($members as $trigger_resource) {
             $this->_CI_load('library', 'kals_actor/User', 'user');
             $association_user = $trigger_resource->get_user();
             $trigger_actor = $this->index_object->get_user();
             $this->_CI_load('library', 'kals_actor/Notification_responded', 'notification_responded');
             $notification = $this->CI->notification_responded->create_notification($association_user, $trigger_resource, $trigger_actor);
             if (is_null($notification)) {
                 handle_error($this->lang->line('notification.responded.create_notification.exception'));
             }
         }
         //foreach($members AS $trigger_resource)
     }
     //if (isset($index_id))
     return $this;
 }
Пример #2
0
 /**
  * 取得自己喜愛的標註list
  * @param Webpage $webpage
  * @return Annotation_collection
  */
 public function get_like_to_annotation($user, Webpage $webpage)
 {
     $webpage_id = $webpage->get_id();
     // use to test
     //$user_id = 2002;
     $user_id = $user->get_id();
     //--------
     $this->db->select('annotation2like.annotation_id');
     $this->db->from('annotation2like');
     $this->db->join('webpage2annotation', 'webpage2annotation.annotation_id = annotation2like.annotation_id');
     $this->db->where('user_id', $user_id);
     $this->db->where('webpage_id', $webpage_id);
     // 要加入未刪除的限制啊!
     $this->db->where("canceled", "false");
     $query = $this->db->get();
     //$count = $query->num_rows();
     $like_to = new Annotation_collection();
     foreach ($query->result() as $row) {
         $like_to->add_item(new Annotation($row->annotation_id));
         //$like_to[] = new Annotation($row->annotation_id);
     }
     return $like_to;
     //return $count;
 }