/** * Removes a tag or a set of tags from the object. As usual, the second * parameter might be an array of tags or a comma-separated string. * * @param BaseObject $object * @param mixed $tagname */ public function removeTagForIndex($tagname) { $tagname = deppPropelActAsTaggableToolkit::explodeTagString($tagname); if (is_array($tagname)) { foreach ($tagname as $tag) { $this->removeTagForIndex($tag); } } else { $tagname = deppPropelActAsTaggableToolkit::cleanTagName($tagname); sfContext::getInstance()->getLogger()->info('{opp_debug}' . $tagname); $tag_object = TagPeer::retrieveByTagname($tagname); $tagging = TaggingForIndexPeer::retrieveByTagAndAtto($tag_object->getId(), $this->getId()); $tagging->delete(); } }
/** * Removes a tag or a set of tags from the object. As usual, the second * parameter might be an array of tags or a comma-separated string. * * @param BaseObject $object * @param mixed $tagname */ public function removeTag(BaseObject $object, $tagname) { $tagname = deppPropelActAsTaggableToolkit::explodeTagString($tagname); if (is_array($tagname)) { foreach ($tagname as $tag) { $this->removeTag($object, $tag); } } else { $tagname = deppPropelActAsTaggableToolkit::cleanTagName($tagname); $tags = self::get_tags($object); $saved_tags = $this->getSavedTags($object); if (isset($tags[$tagname])) { unset($tags[$tagname]); self::set_tags($object, $tags); } if (isset($saved_tags[$tagname])) { unset($saved_tags[$tagname]); self::set_saved_tags($object, $saved_tags); self::add_removed_tag($object, $tagname); } } }