Beispiel #1
0
 protected function _post_update()
 {
     parent::_post_update();
     //假如是喜歡的話……
     $canceled = $this->get_field('canceled');
     if ($canceled === FALSE or $canceled == 'FALSE' or $canceled == 'f') {
         $annotation_id = intval($this->get_field('annotation_id'));
         $user_id = intval($this->get_field('user_id'));
         if ($annotation_id != 0 && $user_id != 0) {
             $this->_CI_load('library', 'kals_resource/Annotation', 'annotation');
             $this->_CI_load('library', 'kals_actor/User', 'user');
             $trigger_resource = new Annotation($annotation_id);
             $association_user = $trigger_resource->get_user();
             $trigger_actor = new User($user_id);
             $this->_CI_load('library', 'kals_actor/Notification_liked', 'notification_liked');
             $notification = $this->CI->notification_liked->create_notification($association_user, $trigger_resource, $trigger_actor);
             if (is_null($notification)) {
                 handle_error($this->lang->line('notification.liked.create_notification.exception'));
             }
         }
     }
     //if ($canceled == FALSE OR $canceled == 'FALSE')
 }
Beispiel #2
0
 public function update()
 {
     if ($this->renewable) {
         return parent::update();
     } else {
         return $this;
     }
 }