removeSubtree() public method

Performs a recursive delete on the location identified by $locationId, including all of its child locations. Content which is not referred to by any other location is automatically removed. Content which looses its main Location will get the first of its other Locations assigned as the new main Location.
public removeSubtree ( mixed $locationId ) : boolean
$locationId mixed
return boolean
Ejemplo n.º 1
0
 /**
  * Deletes all versions and fields, all locations (subtree), and all relations.
  *
  * Removes the relations, but not the related objects. All subtrees of the
  * assigned nodes of this content objects are removed (recursively).
  *
  * @param int $contentId
  *
  * @return bool
  */
 public function deleteContent($contentId)
 {
     $contentLocations = $this->contentGateway->getAllLocationIds($contentId);
     if (empty($contentLocations)) {
         $this->removeRawContent($contentId);
     } else {
         foreach ($contentLocations as $locationId) {
             $this->treeHandler->removeSubtree($locationId);
         }
     }
 }
Ejemplo n.º 2
0
 /**
  * Removes all Locations under and including $locationId.
  *
  * Performs a recursive delete on the location identified by $locationId,
  * including all of its child locations. Content which is not referred to
  * by any other location is automatically removed. Content which looses its
  * main Location will get the first of its other Locations assigned as the
  * new main Location.
  *
  * @param mixed $locationId
  *
  * @return boolean
  */
 public function removeSubtree($locationId)
 {
     $this->treeHandler->removeSubtree($locationId);
 }