public function postUpdate($post)
 {
     if (isset($post['plugin']) && isset($post['plugin'][$this->id])) {
         $category_model = new blogCategoryPostModel();
         $category_model->changePost($post['id'], array_keys($post['plugin'][$this->id]));
     }
 }
 public function deleteByField($field, $value = null)
 {
     $post_category_model = new blogCategoryPostModel();
     if ($field == $this->id) {
         $ids = $value;
     } else {
         $ids = $this->select($this->id)->where($this->getWhereByField($field, $value))->fetchAll();
     }
     $post_category_model->deleteByField('category_id', $ids);
     parent::deleteByField($field, $value);
 }
 public function postUpdate($post)
 {
     $post_id = $post['id'];
     if (isset($post['plugin']) && isset($post['plugin'][$this->id])) {
         if ($post['plugin'][$this->id]) {
             $categories = array_filter(array_keys($post['plugin'][$this->id]));
         } else {
             $categories = array();
         }
         $category_model = new blogCategoryPostModel();
         $category_model->changePost($post['id'], $categories);
     }
 }