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
Example #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);
 }
 /**
  * Changes main location of content identified by given $contentId to location identified by given $locationId
  *
  * Updates ezcontentobject_tree table for the given $contentId and eznode_assignment table for the given
  * $contentId, $parentLocationId and $versionNo
  *
  * @param mixed $contentId
  * @param mixed $locationId
  * @param mixed $versionNo version number, needed to update eznode_assignment table
  * @param mixed $parentLocationId parent location of location identified by $locationId, needed to update
  *        eznode_assignment table
  *
  * @return void
  */
 public function changeMainLocation($contentId, $locationId, $versionNo, $parentLocationId)
 {
     try {
         return $this->innerGateway->changeMainLocation($contentId, $locationId, $versionNo, $parentLocationId);
     } catch (DBALException $e) {
         throw new RuntimeException('Database error', 0, $e);
     } catch (PDOException $e) {
         throw new RuntimeException('Database error', 0, $e);
     }
 }