eZPublishCommunityProject  2013.9
eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler Class Reference

The Location Handler interface defines operations on Location elements in the storage engine. More...

+ Inheritance diagram for eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler:
+ Collaboration diagram for eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler:

Public Member Functions

 __construct (LocationGateway $locationGateway, LocationMapper $locationMapper, ContentHandler $contentHandler, ContentMapper $contentMapper)
 Construct from userGateway. More...
 
 changeMainLocation ($contentId, $locationId)
 Changes main location of content identified by given $contentId to location identified by given $locationId. More...
 
 copySubtree ($sourceId, $destinationParentId)
 Copy location object identified by $sourceId, into destination identified by $destinationParentId. More...
 
 create (CreateStruct $createStruct)
 Creates a new location rooted at $location->parentId. More...
 
 hide ($id)
 Sets a location to be hidden, and it self + all children to invisible. More...
 
 load ($locationId)
 Loads the data for the location identified by $locationId. More...
 
 loadByRemoteId ($remoteId)
 Loads the data for the location identified by $remoteId. More...
 
 loadLocationsByContent ($contentId, $rootLocationId=null)
 Loads all locations for $contentId, optionally limited to a sub tree identified by $rootLocationId. More...
 
 loadParentLocationsForDraftContent ($contentId)
 
 loadSubtreeIds ($locationId)
 Loads the subtree ids of the location identified by $locationId. More...
 
 markSubtreeModified ($locationId, $timestamp=null)
 Marks the given nodes and all ancestors as modified. More...
 
 move ($sourceId, $destinationParentId)
 Moves location identified by $sourceId into new parent identified by $destinationParentId. More...
 
 removeSubtree ($locationId)
 Removes all Locations under and including $locationId. More...
 
 setSectionForSubtree ($locationId, $sectionId)
 Set section on all content objects in the subtree. More...
 
 swap ($locationId1, $locationId2)
 Swaps the content object being pointed to by a location object. More...
 
 unHide ($id)
 Sets a location to be unhidden, and self + children to visible unless a parent is hiding the tree. More...
 
 update (UpdateStruct $location, $locationId)
 Updates an existing location. More...
 

Protected Member Functions

 getParentPathString ($pathString)
 Returns parent path string for a path string. More...
 

Protected Attributes

 $contentHandler
 
 $contentMapper
 
 $locationGateway
 
 $locationMapper
 

Detailed Description

The Location Handler interface defines operations on Location elements in the storage engine.

Constructor & Destructor Documentation

eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler::__construct ( LocationGateway  $locationGateway,
LocationMapper  $locationMapper,
ContentHandler  $contentHandler,
ContentMapper  $contentMapper 
)

Construct from userGateway.

Parameters
\eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway$locationGateway
\eZ\Publish\Core\Persistence\Legacy\Content\Location\Mapper$locationMapper
\eZ\Publish\Core\Persistence\Legacy\Content\Handler$contentHandler
\eZ\Publish\Core\Persistence\Legacy\Content\Mapper$contentMapper
Returns

Member Function Documentation

eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler::changeMainLocation (   $contentId,
  $locationId 
)

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).

Parameters
mixed$contentId
mixed$locationId
Returns
void

Implements eZ\Publish\SPI\Persistence\Content\Location\Handler.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler\copySubtree(), and eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler\removeSubtree().

eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler::copySubtree (   $sourceId,
  $destinationParentId 
)

Copy location object identified by $sourceId, into destination identified by $destinationParentId.

Performs a deep copy of the location identified by $sourceId and all of its child locations, copying the most recent published content object for each location to a new content object without any additional version information. Relations are not copied. URLs are not touched at all.

Todo:
update subtree modification time, optionally retain dates and set creator
Parameters
mixed$sourceId
mixed$destinationParentId
Returns
Location the newly created Location.

Implements eZ\Publish\SPI\Persistence\Content\Location\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler::create ( CreateStruct  $createStruct)

Creates a new location rooted at $location->parentId.

Parameters
\eZ\Publish\SPI\Persistence\Content\Location\CreateStruct$createStruct
Returns

Implements eZ\Publish\SPI\Persistence\Content\Location\Handler.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler\copySubtree().

eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler::getParentPathString (   $pathString)
protected

Returns parent path string for a path string.

Parameters
string$pathString
Returns
string
eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler::hide (   $id)

Sets a location to be hidden, and it self + all children to invisible.

Parameters
mixed$idLocation ID

Implements eZ\Publish\SPI\Persistence\Content\Location\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler::load (   $locationId)

Loads the data for the location identified by $locationId.

Parameters
int$locationId
Returns

Implements eZ\Publish\SPI\Persistence\Content\Location\Handler.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler\changeMainLocation().

eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler::loadByRemoteId (   $remoteId)

Loads the data for the location identified by $remoteId.

Parameters
string$remoteId
Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundException
Returns

Implements eZ\Publish\SPI\Persistence\Content\Location\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler::loadLocationsByContent (   $contentId,
  $rootLocationId = null 
)

Loads all locations for $contentId, optionally limited to a sub tree identified by $rootLocationId.

Parameters
int$contentId
int$rootLocationId
Returns
[]

Implements eZ\Publish\SPI\Persistence\Content\Location\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler::loadParentLocationsForDraftContent (   $contentId)
See Also
::loadParentLocationsForDraftContent

Implements eZ\Publish\SPI\Persistence\Content\Location\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler::loadSubtreeIds (   $locationId)

Loads the subtree ids of the location identified by $locationId.

Parameters
int$locationId
Returns
array Location ids are in the index, Content ids in the value.

Implements eZ\Publish\SPI\Persistence\Content\Location\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler::markSubtreeModified (   $locationId,
  $timestamp = null 
)

Marks the given nodes and all ancestors as modified.

Optionally a time stamp with the modification date may be specified, otherwise the current time is used.

Parameters
int | string$locationId
int$timestamp
Returns
void

Implements eZ\Publish\SPI\Persistence\Content\Location\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler::move (   $sourceId,
  $destinationParentId 
)

Moves location identified by $sourceId into new parent identified by $destinationParentId.

Performs a full move of the location identified by $sourceId to a new destination, identified by $destinationParentId. Relations do not need to be updated, since they refer to Content. URLs are not touched.

Parameters
mixed$sourceId
mixed$destinationParentId
Returns
boolean

Implements eZ\Publish\SPI\Persistence\Content\Location\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler::removeSubtree (   $locationId)

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.

Parameters
mixed$locationId
Returns
boolean

Implements eZ\Publish\SPI\Persistence\Content\Location\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler::setSectionForSubtree (   $locationId,
  $sectionId 
)

Set section on all content objects in the subtree.

Parameters
mixed$locationId
mixed$sectionId
Returns
void

Implements eZ\Publish\SPI\Persistence\Content\Location\Handler.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler\changeMainLocation(), and eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler\copySubtree().

eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler::swap (   $locationId1,
  $locationId2 
)

Swaps the content object being pointed to by a location object.

Make the location identified by $locationId1 refer to the Content referred to by $locationId2 and vice versa.

Parameters
mixed$locationId1
mixed$locationId2
Returns
boolean

Implements eZ\Publish\SPI\Persistence\Content\Location\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler::unHide (   $id)

Sets a location to be unhidden, and self + children to visible unless a parent is hiding the tree.

If not make sure only children down to first hidden node is marked visible.

Parameters
mixed$id

Implements eZ\Publish\SPI\Persistence\Content\Location\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler::update ( UpdateStruct  $location,
  $locationId 
)

Updates an existing location.

Parameters
\eZ\Publish\SPI\Persistence\Content\Location\UpdateStruct$location
int$locationId
Returns
void

Implements eZ\Publish\SPI\Persistence\Content\Location\Handler.

Member Data Documentation

eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler::$contentHandler
protected
eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler::$contentMapper
protected
eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler::$locationGateway
protected
eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler::$locationMapper
protected

The documentation for this class was generated from the following file: