public function saveTags($dataTags) { // current tags in post $oldTags = $this->_tagsToArray(); // tags form Input $newTags = ModelHelper::convertTagsStringToArray($dataTags); // save tags $this->_saveTags(array_diff($newTags, $oldTags)); // detach old tags if (count($oldTags) > 0) { $this->_detachTags(array_diff($oldTags, $newTags)); } }