Beispiel #1
0
 public static function delete_tags_for_post(post_model $post)
 {
     $post_id = $post->id;
     $post_tags = post_tag_model::get(array('post_id' => $post_id));
     if ($post_tags === []) {
         return;
     }
     $tag_ids = [];
     foreach ($post_tags as $post_tag) {
         $tag_ids[] = (int) $post_tag->tag_id;
     }
     post_tag_model::del(array('post_id' => $post_id));
     tag_model::dec_by_ids(array('refer_count' => 1), $tag_ids);
     tag_model::del(array('refer_count' => 0));
 }