Exemplo n.º 1
0
 public function deleteTags($tag_names, PDO $con = null)
 {
     $tags = TagDb::selectByAppIdForUpdate($this->getId(), $con);
     $delete_ids = array();
     $this->tags = new TagSet();
     foreach ($tags as $tag) {
         if (in_array($tag->getName(), $tag_names)) {
             $delete_ids[] = $tag->getId();
         } else {
             $this->tags[] = $tag;
         }
     }
     TagDb::deleteByIds($delete_ids, $con);
 }
Exemplo n.º 2
0
 public function getTags()
 {
     return $this->hasMany(TagDb::className(), ['id' => 'tag']);
 }
Exemplo n.º 3
0
 public function delete($con = null)
 {
     TagDb::removeFromPackage($this, $con);
     return parent::delete($con);
 }