Пример #1
0
 /**
  * Moves all children tags of the provided tag to the new location
  *
  * @static
  * @param eZTagsObject $tag
  * @param eZTagsObject $targetTag
  */
 static function moveChildren($tag, $targetTag)
 {
     $currentTime = time();
     $children = $tag->getChildren();
     foreach ($children as $child) {
         $childSynonyms = $child->getSynonyms();
         foreach ($childSynonyms as $childSynonym) {
             $childSynonym->setAttribute('parent_id', $targetTag->attribute('id'));
             $childSynonym->store();
         }
         $child->setAttribute('parent_id', $targetTag->attribute('id'));
         $child->Modified = $currentTime;
         $child->store();
         $child->updatePathString($targetTag);
         $child->updateDepth($targetTag);
     }
 }