eZPublishCommunityProject  2013.9
eZ\Publish\API\Repository\LocationService Interface Reference
+ Inheritance diagram for eZ\Publish\API\Repository\LocationService:

Public Member Functions

 copySubtree (Location $subtree, Location $targetParentLocation)
 Copies the subtree starting from $subtree as a new subtree of $targetLocation. More...
 
 createLocation (ContentInfo $contentInfo, LocationCreateStruct $locationCreateStruct)
 Creates the new $location in the content repository for the given content. More...
 
 deleteLocation (Location $location)
 Deletes $location and all its descendants. More...
 
 getLocationChildCount (Location $location)
 Returns the number of children which are readable by the current user of a location object. More...
 
 hideLocation (Location $location)
 Hides the $location and marks invisible all descendants of $location. More...
 
 loadLocation ($locationId)
 Loads a location object from its $locationId. More...
 
 loadLocationByRemoteId ($remoteId)
 Loads a location object from its $remoteId. More...
 
 loadLocationChildren (Location $location, $offset=0, $limit=-1)
 Loads children which are readable by the current user of a location object sorted by sortField and sortOrder. More...
 
 loadLocations (ContentInfo $contentInfo, Location $rootLocation=null)
 Loads the locations for the given content object. More...
 
 moveSubtree (Location $location, Location $newParentLocation)
 Moves the subtree to $newParentLocation. More...
 
 newLocationCreateStruct ($parentLocationId)
 Instantiates a new location create class. More...
 
 newLocationUpdateStruct ()
 Instantiates a new location update class. More...
 
 swapLocation (Location $location1, Location $location2)
 Swaps the contents held by $location1 and $location2. More...
 
 unhideLocation (Location $location)
 Unhides the $location. More...
 
 updateLocation (Location $location, LocationUpdateStruct $locationUpdateStruct)
 Updates $location in the content repository. More...
 

Member Function Documentation

eZ\Publish\API\Repository\LocationService::copySubtree ( Location  $subtree,
Location  $targetParentLocation 
)

Copies the subtree starting from $subtree as a new subtree of $targetLocation.

Only the items on which the user has read access are copied.

Exceptions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionIf the current user user is not allowed copy the subtree to the given parent location
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionIf the current user user does not have read access to the whole source subtree
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionif the target location is a sub location of the given location
Parameters
\eZ\Publish\API\Repository\Values\Content\Location$subtree- the subtree denoted by the location to copy
\eZ\Publish\API\Repository\Values\Content\Location$targetParentLocation- the target parent location for the copy operation
Returns
The newly created location of the copied subtree

Implemented in eZ\Publish\Core\REST\Client\LocationService, and eZ\Publish\Core\SignalSlot\LocationService.

eZ\Publish\API\Repository\LocationService::createLocation ( ContentInfo  $contentInfo,
LocationCreateStruct  $locationCreateStruct 
)

Creates the new $location in the content repository for the given content.

Exceptions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionIf the current user user is not allowed to create this location
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionif the content is already below the specified parent or the parent is a sub location of the location of the content or if set the remoteId exists already
Parameters
\eZ\Publish\API\Repository\Values\Content\ContentInfo$contentInfo
\eZ\Publish\API\Repository\Values\Content\LocationCreateStruct$locationCreateStruct
Returns
the newly created Location

Implemented in eZ\Publish\Core\Repository\LocationService, eZ\Publish\Core\SignalSlot\LocationService, and eZ\Publish\Core\REST\Client\LocationService.

eZ\Publish\API\Repository\LocationService::deleteLocation ( Location  $location)

Deletes $location and all its descendants.

Exceptions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionIf the current user is not allowed to delete this location or a descendant
Parameters
\eZ\Publish\API\Repository\Values\Content\Location$location

Implemented in eZ\Publish\Core\REST\Client\LocationService, and eZ\Publish\Core\SignalSlot\LocationService.

eZ\Publish\API\Repository\LocationService::getLocationChildCount ( Location  $location)

Returns the number of children which are readable by the current user of a location object.

Parameters
\eZ\Publish\API\Repository\Values\Content\Location$location
Returns
int

Implemented in eZ\Publish\Core\REST\Client\LocationService, and eZ\Publish\Core\SignalSlot\LocationService.

eZ\Publish\API\Repository\LocationService::hideLocation ( Location  $location)

Hides the $location and marks invisible all descendants of $location.

Exceptions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionIf the current user user is not allowed to hide this location
Parameters
\eZ\Publish\API\Repository\Values\Content\Location$location
Returns
$location, with updated hidden value

Implemented in eZ\Publish\Core\REST\Client\LocationService, and eZ\Publish\Core\SignalSlot\LocationService.

eZ\Publish\API\Repository\LocationService::loadLocation (   $locationId)

Loads a location object from its $locationId.

Exceptions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionIf the current user user is not allowed to read this location
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionIf the specified location is not found
Parameters
mixed$locationId
Returns

Implemented in eZ\Publish\Core\Repository\LocationService, eZ\Publish\Core\REST\Client\LocationService, and eZ\Publish\Core\SignalSlot\LocationService.

eZ\Publish\API\Repository\LocationService::loadLocationByRemoteId (   $remoteId)

Loads a location object from its $remoteId.

Exceptions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionIf the current user user is not allowed to read this location
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionIf the specified location is not found
Parameters
string$remoteId
Returns

Implemented in eZ\Publish\Core\Repository\LocationService, eZ\Publish\Core\REST\Client\LocationService, and eZ\Publish\Core\SignalSlot\LocationService.

eZ\Publish\API\Repository\LocationService::loadLocationChildren ( Location  $location,
  $offset = 0,
  $limit = -1 
)

Loads children which are readable by the current user of a location object sorted by sortField and sortOrder.

Parameters
\eZ\Publish\API\Repository\Values\Content\Location$location
int$offsetthe start offset for paging
int$limitthe number of locations returned. If $limit = -1 all children starting at $offset are returned
Returns

Implemented in eZ\Publish\Core\REST\Client\LocationService, and eZ\Publish\Core\SignalSlot\LocationService.

eZ\Publish\API\Repository\LocationService::loadLocations ( ContentInfo  $contentInfo,
Location  $rootLocation = null 
)

Loads the locations for the given content object.

If a $rootLocation is given, only locations that belong to this location are returned. The location list is also filtered by permissions on reading locations.

Exceptions
\eZ\Publish\API\Repository\Exceptions\BadStateExceptionif there is no published version yet
Parameters
\eZ\Publish\API\Repository\Values\Content\ContentInfo$contentInfo
\eZ\Publish\API\Repository\Values\Content\Location$rootLocation
Returns
[] An array of Location

Implemented in eZ\Publish\Core\REST\Client\LocationService, and eZ\Publish\Core\SignalSlot\LocationService.

eZ\Publish\API\Repository\LocationService::moveSubtree ( Location  $location,
Location  $newParentLocation 
)

Moves the subtree to $newParentLocation.

If a user has the permission to move the location to a target location he can do it regardless of an existing descendant on which the user has no permission.

Exceptions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionIf the current user user is not allowed to move this location to the target
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionIf the current user user does not have read access to the whole source subtree
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionif the new parent is in a subtree of the location
Parameters
\eZ\Publish\API\Repository\Values\Content\Location$location
\eZ\Publish\API\Repository\Values\Content\Location$newParentLocation

Implemented in eZ\Publish\Core\REST\Client\LocationService, and eZ\Publish\Core\SignalSlot\LocationService.

eZ\Publish\API\Repository\LocationService::newLocationCreateStruct (   $parentLocationId)

Instantiates a new location create class.

Parameters
mixed$parentLocationIdthe parent under which the new location should be created
Returns

Implemented in eZ\Publish\Core\Repository\LocationService, eZ\Publish\Core\SignalSlot\LocationService, and eZ\Publish\Core\REST\Client\LocationService.

eZ\Publish\API\Repository\LocationService::newLocationUpdateStruct ( )
eZ\Publish\API\Repository\LocationService::swapLocation ( Location  $location1,
Location  $location2 
)

Swaps the contents held by $location1 and $location2.

Exceptions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionIf the current user user is not allowed to swap content
Parameters
\eZ\Publish\API\Repository\Values\Content\Location$location1
\eZ\Publish\API\Repository\Values\Content\Location$location2

Implemented in eZ\Publish\Core\REST\Client\LocationService, and eZ\Publish\Core\SignalSlot\LocationService.

eZ\Publish\API\Repository\LocationService::unhideLocation ( Location  $location)

Unhides the $location.

This method and marks visible all descendants of $locations until a hidden location is found.

Exceptions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionIf the current user user is not allowed to unhide this location
Parameters
\eZ\Publish\API\Repository\Values\Content\Location$location
Returns
$location, with updated hidden value

Implemented in eZ\Publish\Core\REST\Client\LocationService, and eZ\Publish\Core\SignalSlot\LocationService.

eZ\Publish\API\Repository\LocationService::updateLocation ( Location  $location,
LocationUpdateStruct  $locationUpdateStruct 
)

Updates $location in the content repository.

Exceptions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionIf the current user user is not allowed to update this location
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionif if set the remoteId exists already
Parameters
\eZ\Publish\API\Repository\Values\Content\Location$location
\eZ\Publish\API\Repository\Values\Content\LocationUpdateStruct$locationUpdateStruct
Returns
the updated Location

Implemented in eZ\Publish\Core\SignalSlot\LocationService, and eZ\Publish\Core\REST\Client\LocationService.


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