eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway::changeMainLocation PHP Method

changeMainLocation() abstract public method

Updates ezcontentobject_tree table for the given $contentId and eznode_assignment table for the given $contentId, $parentLocationId and $versionNo
abstract public changeMainLocation ( mixed $contentId, mixed $locationId, mixed $versionNo, mixed $parentLocationId )
$contentId mixed
$locationId mixed
$versionNo mixed version number, needed to update eznode_assignment table
$parentLocationId mixed parent location of location identified by $locationId, needed to update eznode_assignment table
    public abstract function changeMainLocation($contentId, $locationId, $versionNo, $parentLocationId);

Usage Example

Ejemplo n.º 1
0
 /**
  * Changes main location of content identified by given $contentId to location identified by given $locationId.
  *
  * Updates ezcontentobject_tree and eznode_assignment tables (eznode_assignment for content current version number).
  *
  * @param mixed $contentId
  * @param mixed $locationId
  */
 public function changeMainLocation($contentId, $locationId)
 {
     $parentLocationId = $this->loadLocation($locationId)->parentId;
     // Update ezcontentobject_tree and eznode_assignment tables
     $this->locationGateway->changeMainLocation($contentId, $locationId, $this->loadContentInfo($contentId)->currentVersionNo, $parentLocationId);
     // Update subtree section to the one of the new main location parent location content
     $this->setSectionForSubtree($locationId, $this->loadContentInfo($this->loadLocation($parentLocationId)->contentId)->sectionId);
 }
All Usage Examples Of eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway::changeMainLocation