Пример #1
0
 /**
  * Recursively deletes all children tags of the given tag, including the given tag itself
  *
  * @static
  * @param eZTagsObject $rootTag
  */
 static function recursiveTagDelete($rootTag)
 {
     $children = self::fetchByParentID($rootTag->attribute('id'));
     foreach ($children as $child) {
         self::recursiveTagDelete($child);
     }
     $rootTag->registerSearchObjects();
     foreach ($rootTag->getTagAttributeLinks() as $tagAttributeLink) {
         $tagAttributeLink->remove();
     }
     $synonyms = $rootTag->getSynonyms();
     foreach ($synonyms as $synonym) {
         foreach ($synonym->getTagAttributeLinks() as $tagAttributeLink) {
             $tagAttributeLink->remove();
         }
         $synonym->remove();
     }
     $rootTag->remove();
 }