historizeId() 추상적인 공개 메소드

This method is used by Handler::locationMoved(). Each row is separately historized because future publishing needs to be able to take over history entries safely.
abstract public historizeId ( mixed $id, mixed $link )
$id mixed
$link mixed
 /**
  * Marks all entries with given $id as history entries.
  *
  * This method is used by Handler::locationMoved(). Each row is separately historized
  * because future publishing needs to be able to take over history entries safely.
  *
  * @param mixed $id
  * @param mixed $link
  */
 public function historizeId($id, $link)
 {
     try {
         $this->innerGateway->historizeId($id, $link);
     } catch (DBALException $e) {
         throw new \RuntimeException('Database error', 0, $e);
     } catch (PDOException $e) {
         throw new \RuntimeException('Database error', 0, $e);
     }
 }
예제 #2
0
 /**
  * Notifies the underlying engine that a location has moved.
  *
  * This method triggers the change of the autogenerated aliases.
  *
  * @param mixed $locationId
  * @param mixed $oldParentId
  * @param mixed $newParentId
  */
 public function locationMoved($locationId, $oldParentId, $newParentId)
 {
     // @todo optimize: $newLocationAliasId is already available in self::publishUrlAliasForLocation() as $newId
     $newParentLocationAliasId = $this->getRealAliasId($newParentId);
     $newLocationAlias = $this->gateway->loadAutogeneratedEntry('eznode:' . $locationId, $newParentLocationAliasId);
     $oldParentLocationAliasId = $this->getRealAliasId($oldParentId);
     $oldLocationAlias = $this->gateway->loadAutogeneratedEntry('eznode:' . $locationId, $oldParentLocationAliasId);
     // Historize alias for old location
     $this->gateway->historizeId($oldLocationAlias['id'], $newLocationAlias['id']);
     // Reparent subtree of old location to new location
     $this->gateway->reparent($oldLocationAlias['id'], $newLocationAlias['id']);
 }