eZPublishCommunityProject  2012.12
eZ\Publish\SPI\Persistence\Content\Location\Handler Interface Reference

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

+ Inheritance diagram for eZ\Publish\SPI\Persistence\Content\Location\Handler:

Public Member Functions

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

Detailed Description

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

Member Function Documentation

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

Changes main location of content identified by given $contentId to location identified by given $locationId.

Parameters
mixed$contentId
mixed$locationId
Returns
void

Implemented in eZ\Publish\Core\Persistence\InMemory\LocationHandler, and eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler.

eZ\Publish\SPI\Persistence\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.

Parameters
mixed$sourceId
mixed$destinationParentId
Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionIf $sourceId or $destinationParentId are invalid
Returns
Location the newly created Location.

Implemented in eZ\Publish\Core\Persistence\InMemory\LocationHandler.

eZ\Publish\SPI\Persistence\Content\Location\Handler::create ( CreateStruct  $location)

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

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

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler.

eZ\Publish\SPI\Persistence\Content\Location\Handler::hide (   $id)

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

Parameters
mixed$idLocation ID

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler, and eZ\Publish\Core\Persistence\InMemory\LocationHandler.

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

Loads the data for the location identified by $locationId.

Parameters
int$locationId
Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundException
Returns

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler, and eZ\Publish\Core\Persistence\InMemory\LocationHandler.

eZ\Publish\SPI\Persistence\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

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler, and eZ\Publish\Core\Persistence\InMemory\LocationHandler.

eZ\Publish\SPI\Persistence\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
[]

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler, and eZ\Publish\Core\Persistence\InMemory\LocationHandler.

eZ\Publish\SPI\Persistence\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

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler, and eZ\Publish\Core\Persistence\InMemory\LocationHandler.

eZ\Publish\SPI\Persistence\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

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler, and eZ\Publish\Core\Persistence\InMemory\LocationHandler.

eZ\Publish\SPI\Persistence\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

Implemented in eZ\Publish\Core\Persistence\InMemory\LocationHandler, and eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler.

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

Set section on all content objects in the subtree.

Only main locations will be updated

Todo:
This can be confusing (regarding permissions and main/multi location). So method is for the time being not in PublicAPI so people can instead write scripts using their own logic against the assignSectionToContent() api.
Parameters
mixed$locationId
mixed$sectionId
Returns
void

Implemented in eZ\Publish\Core\Persistence\InMemory\LocationHandler, and eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler.

eZ\Publish\SPI\Persistence\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

Implemented in eZ\Publish\Core\Persistence\InMemory\LocationHandler, and eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler.

eZ\Publish\SPI\Persistence\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

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler, and eZ\Publish\Core\Persistence\InMemory\LocationHandler.

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

Updates an existing location.

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

Implemented in eZ\Publish\Core\Persistence\InMemory\LocationHandler, and eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler.


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