예제 #1
0
 public function updateTags()
 {
     $oldTags = $this->string2array($this->oldTags);
     $newTags = $this->string2array($this->owner->{$this->attribute});
     Tag::addTags(array_values(array_diff($newTags, $oldTags)), $this->tagType);
     Tag::removeTags(array_values(array_diff($oldTags, $newTags)), $this->tagType);
 }
예제 #2
0
 /**
  * Look into Tag model by tag type
  * @return mixed
  */
 private function getAllTags()
 {
     return Tag::find()->where(['tag_type' => $this->model->className()])->limit(20);
 }