eZPublishCommunityProject  2013.9
eZ\Publish\Core\SignalSlot\LocationService Class Reference
+ Inheritance diagram for eZ\Publish\Core\SignalSlot\LocationService:
+ Collaboration diagram for eZ\Publish\Core\SignalSlot\LocationService:

Public Member Functions

 __construct (LocationServiceInterface $service, SignalDispatcher $signalDispatcher)
 Constructor. More...
 
 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...
 

Protected Attributes

 $service
 
 $signalDispatcher
 

Constructor & Destructor Documentation

eZ\Publish\Core\SignalSlot\LocationService::__construct ( LocationServiceInterface  $service,
SignalDispatcher  $signalDispatcher 
)

Constructor.

Construct service object from aggregated service and signal dispatcher

Parameters
\eZ\Publish\API\Repository\LocationService$service
\eZ\Publish\Core\SignalSlot\SignalDispatcher$signalDispatcher

Member Function Documentation

eZ\Publish\Core\SignalSlot\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

Implements eZ\Publish\API\Repository\LocationService.

eZ\Publish\Core\SignalSlot\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

Implements eZ\Publish\API\Repository\LocationService.

eZ\Publish\Core\SignalSlot\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

Implements eZ\Publish\API\Repository\LocationService.

eZ\Publish\Core\SignalSlot\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

Implements eZ\Publish\API\Repository\LocationService.

eZ\Publish\Core\SignalSlot\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

Implements eZ\Publish\API\Repository\LocationService.

eZ\Publish\Core\SignalSlot\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

Implements eZ\Publish\API\Repository\LocationService.

eZ\Publish\Core\SignalSlot\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

Implements eZ\Publish\API\Repository\LocationService.

eZ\Publish\Core\SignalSlot\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

Implements eZ\Publish\API\Repository\LocationService.

eZ\Publish\Core\SignalSlot\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

Implements eZ\Publish\API\Repository\LocationService.

eZ\Publish\Core\SignalSlot\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
Parameters
\eZ\Publish\API\Repository\Values\Content\Location$location
\eZ\Publish\API\Repository\Values\Content\Location$newParentLocation

Implements eZ\Publish\API\Repository\LocationService.

eZ\Publish\Core\SignalSlot\LocationService::newLocationCreateStruct (   $parentLocationId)

Instantiates a new location create class.

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

Implements eZ\Publish\API\Repository\LocationService.

eZ\Publish\Core\SignalSlot\LocationService::newLocationUpdateStruct ( )

Instantiates a new location update class.

Returns

Implements eZ\Publish\API\Repository\LocationService.

eZ\Publish\Core\SignalSlot\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

Implements eZ\Publish\API\Repository\LocationService.

eZ\Publish\Core\SignalSlot\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

Implements eZ\Publish\API\Repository\LocationService.

eZ\Publish\Core\SignalSlot\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

Implements eZ\Publish\API\Repository\LocationService.

Member Data Documentation

eZ\Publish\Core\SignalSlot\LocationService::$service
protected
eZ\Publish\Core\SignalSlot\LocationService::$signalDispatcher
protected

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