Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Public Member Functions | List of all members
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
| load ($locationId, array $translations=null, bool $useAlwaysAvailable=true)
| Loads the data for the location identified by $locationId. More...
| loadList (array $locationIds, array $translations=null, bool $useAlwaysAvailable=true)
| Return list of unique Locations, with location id as key. More...
| loadSubtreeIds ($locationId)
| Loads the subtree ids of the location identified by $locationId. More...
| loadByRemoteId ($remoteId, array $translations=null, bool $useAlwaysAvailable=true)
| 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...
| loadLocationsByTrashContent (int $contentId, ?int $rootLocationId=null)
| Loads all locations for $contentId in trash, optionally limited to a sub tree identified by $rootLocationId. More...
| loadParentLocationsForDraftContent ($contentId)
| Loads all parent Locations for unpublished Content by given $contentId. More...
| copySubtree ($sourceId, $destinationParentId)
| Copy location object identified by $sourceId, into destination identified by $destinationParentId. More...
| move ($sourceId, $destinationParentId)
| Moves location identified by $sourceId into new parent identified by $destinationParentId. More...
| markSubtreeModified ($locationId, $timestamp=null)
| Marks the given nodes and all ancestors as modified. More...
| hide ($id)
| Sets a location to be hidden, and it self + all children to invisible. More...
| unHide ($id)
| Sets a location to be unhidden, and self + children to visible unless a parent is hiding the tree. More...
| setInvisible (int $id)
| Sets a location + all children to invisible. More...
| setVisible (int $id)
| Sets a location + all children to visible. More...
| swap ($locationId1, $locationId2)
| Swaps the content object being pointed to by a location object. More...
| update (UpdateStruct $location, $locationId)
| Updates an existing location. More...
| create (CreateStruct $location)
| Creates a new location rooted at $location->parentId. More...
| removeSubtree ($locationId)
| Removes all Locations under and including $locationId. More...
| setSectionForSubtree ($locationId, $sectionId)
| Set section on all content objects in the subtree. More...
| changeMainLocation ($contentId, $locationId)
| Changes main location of content identified by given $contentId to location identified by given $locationId. More...
| countAllLocations ()
| Get the total number of all existing Locations. More...
| loadAllLocations ($offset, $limit)
| Bulk-load all existing Locations, constrained by $limit and $offset to paginate results. More...

## Detailed Description

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

Definition at line 14 of file SPI/Persistence/Content/Location/Handler.php.

## Member Function Documentation

## ◆ changeMainLocation()

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 |

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

## ◆ copySubtree()

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 for published version are copied. URLs are not touched at all.

Parameters

  mixed | $sourceId |
  mixed | $destinationParentId |

Exceptions

## ◆ countAllLocations()

eZ\Publish\SPI\Persistence\Content\Location\Handler::countAllLocations | ( |  | ) |

Get the total number of all existing Locations.

Can be combined with loadAllLocations.

Returns
  int

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

## ◆ create()

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

## ◆ hide()

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

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

Parameters

  mixed | $id | Location ID

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

## ◆ load()

eZ\Publish\SPI\Persistence\Content\Location\Handler::load | ( |  | $locationId,
|  | array | $translations = `null`,
|  | bool | $useAlwaysAvailable = `true`
| ) |  |

Loads the data for the location identified by $locationId.

Parameters

  int | $locationId |
  string[] | null | $translations | If set, NotFound is thrown if content is not in given translation.
  bool | $useAlwaysAvailable | Respect always available flag on content, where main language is valid translation fallback.

Exceptions

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

## ◆ loadAllLocations()

eZ\Publish\SPI\Persistence\Content\Location\Handler::loadAllLocations | ( |  | $offset,
|  |  | $limit
| ) |  |

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

Parameters

  int | $offset |
  int | $limit |

Returns
  \eZ\Publish\SPI\Persistence\Content\Location[]

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

## ◆ loadByRemoteId()

eZ\Publish\SPI\Persistence\Content\Location\Handler::loadByRemoteId | ( |  | $remoteId,
|  | array | $translations = `null`,
|  | bool | $useAlwaysAvailable = `true`
| ) |  |

Loads the data for the location identified by $remoteId.

Parameters

  string | $remoteId |
  string[] | null | $translations | If set, NotFound is thrown if content is not in given translation.
  bool | $useAlwaysAvailable | Respect always available flag on content, where main language is valid translation fallback.

Exceptions

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

## ◆ loadList()

eZ\Publish\SPI\Persistence\Content\Location\Handler::loadList | ( | array | $locationIds,
|  | array | $translations = `null`,
|  | bool | $useAlwaysAvailable = `true`
| ) |  |

Return list of unique Locations, with location id as key.

Missing items (NotFound) will be missing from the array and not cause an exception, it's up to calling logic to determine if this should cause exception or not.

Parameters

  int[] | $locationIds |
  string[] | null | $translations | If set, only locations with content in given translations are returned.
  bool | $useAlwaysAvailable | Respect always available flag on content, where main language is valid translation fallback.

Returns
  \eZ\Publish\SPI\Persistence\Content\Location[]|iterable

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

## ◆ loadLocationsByContent()

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

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

## ◆ loadLocationsByTrashContent()

eZ\Publish\SPI\Persistence\Content\Location\Handler::loadLocationsByTrashContent | ( | int | $contentId,
|  | ?int | $rootLocationId = `null`
| ) |  |

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

Returns
  \eZ\Publish\SPI\Persistence\Content\Location[]

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

## ◆ loadParentLocationsForDraftContent()

eZ\Publish\SPI\Persistence\Content\Location\Handler::loadParentLocationsForDraftContent | ( |  | $contentId | ) |

Loads all parent Locations for unpublished Content by given $contentId.

Parameters

  mixed | $contentId |

Returns
  \eZ\Publish\SPI\Persistence\Content\Location[]

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

## ◆ loadSubtreeIds()

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

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

Parameters

  int | $locationId |

Exceptions

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

## ◆ markSubtreeModified()

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.

Deprecated:
  As of 6.8, not been used by repository since 5.x.

Parameters

  int | string | $locationId |
  int | $timestamp |

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

## ◆ move()

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
  bool

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

## ◆ removeSubtree()

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
  bool

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

## ◆ setInvisible()

eZ\Publish\SPI\Persistence\Content\Location\Handler::setInvisible | ( | int | $id | ) |

Sets a location + all children to invisible.

Parameters

  int | $id | Location ID

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

## ◆ setSectionForSubtree()

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 |

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

## ◆ setVisible()

eZ\Publish\SPI\Persistence\Content\Location\Handler::setVisible | ( | int | $id | ) |

Sets a location + all children to visible.

Parameters

  int | $id | Location ID

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

## ◆ swap()

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
  bool

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

## ◆ unHide()

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\Cache\LocationHandler, and eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler.

## ◆ update()

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 |

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

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

- SPI/Persistence/Content/Location/Handler.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.