Copied!

LocationServiceDecorator

LocationServiceDecorator.php : 20
Implements LocationService

Properties

protected $innerService

LocationServiceDecorator.php : 23
protected LocationService $innerService

Methods

public__construct()

LocationServiceDecorator.php : 25
public __construct(LocationService $innerService)

Parameters

Name Type Default value Description
$innerService LocationService - -

publiccopySubtree()

LocationServiceDecorator.php : 30

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

public copySubtree(Location $subtree, Location $targetParentLocation) : Location

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

Parameters

Name Type Default value Description
$subtree Location -

the subtree denoted by the location to copy

$targetParentLocation Location -

the target parent location for the copy operation

Return values

Location

The newly created location of the copied subtree

publiccount()

LocationServiceDecorator.php : 163

Count total number of items returned by {@see find} method.

public count(Filter $filter[, array<string|int, mixed>|null $languages = null ]) : int

Parameters

Name Type Default value Description
$filter Filter - -
$languages array<string|int, mixed>|null null

a list of language codes to be added as additional constraints. If skipped, by default, unless SiteAccessAware layer has been disabled, languages set for a SiteAccess in a current context will be used.

Return values

int

publiccreateLocation()

LocationServiceDecorator.php : 95

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

public createLocation(ContentInfo $contentInfo, LocationCreateStruct $locationCreateStruct) : Location

Parameters

Name Type Default value Description
$contentInfo ContentInfo - -
$locationCreateStruct LocationCreateStruct - -

Return values

Location

the newly created Location

publicdeleteLocation()

LocationServiceDecorator.php : 131

Deletes $location and all its descendants.

public deleteLocation(Location $location) : void

Parameters

Name Type Default value Description
$location Location - -

publicfind()

LocationServiceDecorator.php : 158

Fetch a LocationList from the Repository filtered by the given conditions.

public find(Filter $filter[, array<string|int, mixed>|null $languages = null ]) : LocationList

Parameters

Name Type Default value Description
$filter Filter - -
$languages array<string|int, mixed>|null null

a list of language codes to be added as additional constraints. If skipped, by default, unless SiteAccessAware layer has been disabled, languages set for a SiteAccess in a current context will be used.

Return values

LocationList

publicgetAllLocationsCount()

LocationServiceDecorator.php : 146

Get the total number of all existing Locations. Can be combined with loadAllLocations.

public getAllLocationsCount() : int

Return values

int

Total number of Locations

publicgetLocationChildCount()

LocationServiceDecorator.php : 85

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

public getLocationChildCount(Location $location) : int

Parameters

Name Type Default value Description
$location Location - -

Return values

int

publicgetSubtreeSize()

LocationServiceDecorator.php : 90

Return the subtree size of a given location.

public getSubtreeSize(Location $location) : int

Warning! This method is not permission aware by design.

Parameters

Name Type Default value Description
$location Location - -

Return values

int

publichideLocation()

LocationServiceDecorator.php : 114

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

public hideLocation(Location $location) : Location

Parameters

Name Type Default value Description
$location Location - -

Return values

Location

$location, with updated hidden value

publicloadAllLocations()

LocationServiceDecorator.php : 151

Bulk-load all existing Locations, constrained by $limit and $offset to paginate results.

public loadAllLocations([int $offset = 0 ][, int $limit = 25 ]) : array<string|int, Location>

Parameters

Name Type Default value Description
$offset int 0 -
$limit int 25 -

Return values

array<string|int, Location>

publicloadLocation()

LocationServiceDecorator.php : 37

Loads a location object from its $locationId.

public loadLocation(int $locationId[, array<string|int, mixed>|null $prioritizedLanguages = null ][, bool|null $useAlwaysAvailable = null ]) : Location

Parameters

Name Type Default value Description
$locationId int - -
$prioritizedLanguages array<string|int, mixed>|null null

Filter on and use as prioritized language code on translated properties of returned object.

$useAlwaysAvailable bool|null null

Respect always available flag on content when filtering on $prioritizedLanguages.

Return values

Location

publicloadLocationByRemoteId()

LocationServiceDecorator.php : 53

Loads a location object from its $remoteId.

public loadLocationByRemoteId(string $remoteId[, array<string|int, mixed>|null $prioritizedLanguages = null ][, bool|null $useAlwaysAvailable = null ]) : Location

Parameters

Name Type Default value Description
$remoteId string - -
$prioritizedLanguages array<string|int, mixed>|null null

Filter on and use as prioritized language code on translated properties of returned object.

$useAlwaysAvailable bool|null null

Respect always available flag on content when filtering on $prioritizedLanguages.

Return values

Location

publicloadLocationChildren()

LocationServiceDecorator.php : 69

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

public loadLocationChildren(Location $location[, int $offset = 0 ][, int $limit = 25 ][, array<string|int, mixed>|null $prioritizedLanguages = null ]) : LocationList

Use this method with caution. It performs heavy queries on the database. Consider using SearchService::findLocations() with ChildrenQueryType as an alternative.

Parameters

Name Type Default value Description
$location Location - -
$offset int 0

the start offset for paging

$limit int 25

the number of locations returned

$prioritizedLanguages array<string|int, mixed>|null null

Used as prioritized language code on translated properties of returned object.

Return values

LocationList

publicloadLocationList()

LocationServiceDecorator.php : 45

Loads several location objects from its $locationIds.

public loadLocationList(array<string|int, mixed> $locationIds[, array<string|int, mixed>|null $prioritizedLanguages = null ][, bool|null $useAlwaysAvailable = null ]) : array<string|int, Location>|iterable<string|int, mixed>

Returned list of Locations will be filtered by what is found and what current user has access to.

Parameters

Name Type Default value Description
$locationIds array<string|int, mixed> - -
$prioritizedLanguages array<string|int, mixed>|null null

Filter on and use as prioritized language code on translated properties of returned objects.

$useAlwaysAvailable bool|null null

Respect always available flag on content when filtering on $prioritizedLanguages.

Return values

array<string|int, Location>|iterable<string|int, mixed>

publicloadLocations()

LocationServiceDecorator.php : 61

Loads the locations for the given content object.

public loadLocations(ContentInfo $contentInfo[, Location|null $rootLocation = null ][, array<string|int, mixed>|null $prioritizedLanguages = null ]) : array<string|int, Location>

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.

Parameters

Name Type Default value Description
$contentInfo ContentInfo - -
$rootLocation Location|null null -
$prioritizedLanguages array<string|int, mixed>|null null

Used as prioritized language code on translated properties of returned object.

Return values

array<string|int, Location>

An array of Location

publicloadParentLocationsForDraftContent()

LocationServiceDecorator.php : 78

Load parent Locations for Content Draft.

public loadParentLocationsForDraftContent(VersionInfo $versionInfo[, array<string|int, mixed>|null $prioritizedLanguages = null ]) : array<string|int, Location>

Parameters

Name Type Default value Description
$versionInfo VersionInfo - -
$prioritizedLanguages array<string|int, mixed>|null null

Used as prioritized language code on translated properties of returned object.

Return values

array<string|int, Location>

List of parent Locations

publicmoveSubtree()

LocationServiceDecorator.php : 124

Moves the subtree to $newParentLocation.

public moveSubtree(Location $location, Location $newParentLocation) : void

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.

Parameters

Name Type Default value Description
$location Location - -
$newParentLocation Location - -

publicnewLocationCreateStruct()

LocationServiceDecorator.php : 136

Instantiates a new location create class.

public newLocationCreateStruct(int $parentLocationId) : LocationCreateStruct

Parameters

Name Type Default value Description
$parentLocationId int -

the parent under which the new location should be created

Return values

LocationCreateStruct

publicnewLocationUpdateStruct()

LocationServiceDecorator.php : 141

Instantiates a new location update class.

public newLocationUpdateStruct() : LocationUpdateStruct

Return values

LocationUpdateStruct

publicswapLocation()

LocationServiceDecorator.php : 109

Swaps the contents held by $location1 and $location2.

public swapLocation(Location $location1, Location $location2) : void

Parameters

Name Type Default value Description
$location1 Location - -
$location2 Location - -

publicunhideLocation()

LocationServiceDecorator.php : 119

Unhides the $location.

public unhideLocation(Location $location) : Location

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

Parameters

Name Type Default value Description
$location Location - -

Return values

Location

$location, with updated hidden value

publicupdateLocation()

LocationServiceDecorator.php : 102

Updates $location in the content repository.

public updateLocation(Location $location, LocationUpdateStruct $locationUpdateStruct) : Location

Parameters

Name Type Default value Description
$location Location - -
$locationUpdateStruct LocationUpdateStruct - -

Return values

Location

the updated Location