PHP Class eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler

Inheritance: implements eZ\Publish\SPI\Persistence\Content\Location\Handler
Afficher le fichier Open project: ezsystems/ezpublish-kernel Class Usage Examples

Protected Properties

Свойство Type Description
$contentHandler eZ\Publish\Core\Persistence\Legacy\Content\Handler Content handler.
$locationGateway Gateway Gateway for handling location data.
$locationMapper Mapper Location locationMapper.
$objectStateHandler eZ\Publish\Core\Persistence\Legacy\Content\ObjectState\Handler Object state handler.
$treeHandler eZ\Publish\Core\Persistence\Legacy\Content\TreeHandler Tree handler.

Méthodes publiques

Méthode Description
__construct ( Gateway $locationGateway, Mapper $locationMapper, Handler $contentHandler, Handler $objectStateHandler, TreeHandler $treeHandler ) : Handler Construct from userGateway.
changeMainLocation ( mixed $contentId, mixed $locationId ) Changes main location of content identified by given $contentId to location identified by given $locationId.
copySubtree ( mixed $sourceId, mixed $destinationParentId ) : eZ\Publish\SPI\Persistence\Content\Location Copy location object identified by $sourceId, into destination identified by $destinationParentId.
create ( eZ\Publish\SPI\Persistence\Content\Location\CreateStruct $createStruct ) : eZ\Publish\SPI\Persistence\Content\Location Creates a new location rooted at $location->parentId.
hide ( mixed $id ) Sets a location to be hidden, and it self + all children to invisible.
load ( integer $locationId ) : eZ\Publish\SPI\Persistence\Content\Location Loads the data for the location identified by $locationId.
loadByRemoteId ( string $remoteId ) : eZ\Publish\SPI\Persistence\Content\Location Loads the data for the location identified by $remoteId.
loadLocationsByContent ( integer $contentId, integer $rootLocationId = null ) : eZ\Publish\SPI\Persistence\Content\Location[] Loads all locations for $contentId, optionally limited to a sub tree identified by $rootLocationId.
loadParentLocationsForDraftContent ( $contentId )
loadSubtreeIds ( integer $locationId ) : array Loads the subtree ids of the location identified by $locationId.
markSubtreeModified ( integer | string $locationId, integer $timestamp = null ) Marks the given nodes and all ancestors as modified.
move ( mixed $sourceId, mixed $destinationParentId ) : boolean Moves location identified by $sourceId into new parent identified by $destinationParentId.
removeSubtree ( mixed $locationId ) : boolean Removes all Locations under and including $locationId.
setSectionForSubtree ( mixed $locationId, mixed $sectionId ) Set section on all content objects in the subtree.
swap ( mixed $locationId1, mixed $locationId2 ) : boolean Swaps the content object being pointed to by a location object.
unHide ( mixed $id ) Sets a location to be unhidden, and self + children to visible unless a parent is hiding the tree.
update ( eZ\Publish\SPI\Persistence\Content\Location\UpdateStruct $location, integer $locationId ) Updates an existing location.

Méthodes protégées

Méthode Description
getDefaultContentStates ( ) : eZ\Publish\SPI\Persistence\Content\ObjectState[] Returns an array of default content states with content state group id as key.
getParentPathString ( string $pathString ) : string Returns parent path string for a path string.
setContentStates ( eZ\Publish\SPI\Persistence\Content $content, array $contentStates )

Method Details

__construct() public méthode

Construct from userGateway.
public __construct ( Gateway $locationGateway, Mapper $locationMapper, Handler $contentHandler, Handler $objectStateHandler, TreeHandler $treeHandler ) : Handler
$locationGateway Gateway
$locationMapper Mapper
$contentHandler eZ\Publish\Core\Persistence\Legacy\Content\Handler
$objectStateHandler eZ\Publish\Core\Persistence\Legacy\Content\ObjectState\Handler
$treeHandler eZ\Publish\Core\Persistence\Legacy\Content\TreeHandler
Résultat Handler

changeMainLocation() public méthode

Updates ezcontentobject_tree and eznode_assignment tables (eznode_assignment for content current version number).
public changeMainLocation ( mixed $contentId, mixed $locationId )
$contentId mixed
$locationId mixed

copySubtree() public méthode

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.
public copySubtree ( mixed $sourceId, mixed $destinationParentId ) : eZ\Publish\SPI\Persistence\Content\Location
$sourceId mixed
$destinationParentId mixed
Résultat eZ\Publish\SPI\Persistence\Content\Location the newly created Location.

create() public méthode

Creates a new location rooted at $location->parentId.
public create ( eZ\Publish\SPI\Persistence\Content\Location\CreateStruct $createStruct ) : eZ\Publish\SPI\Persistence\Content\Location
$createStruct eZ\Publish\SPI\Persistence\Content\Location\CreateStruct
Résultat eZ\Publish\SPI\Persistence\Content\Location

getDefaultContentStates() protected méthode

Returns an array of default content states with content state group id as key.
protected getDefaultContentStates ( ) : eZ\Publish\SPI\Persistence\Content\ObjectState[]
Résultat eZ\Publish\SPI\Persistence\Content\ObjectState[]

getParentPathString() protected méthode

Returns parent path string for a path string.
protected getParentPathString ( string $pathString ) : string
$pathString string
Résultat string

hide() public méthode

Sets a location to be hidden, and it self + all children to invisible.
public hide ( mixed $id )
$id mixed Location ID

load() public méthode

Loads the data for the location identified by $locationId.
public load ( integer $locationId ) : eZ\Publish\SPI\Persistence\Content\Location
$locationId integer
Résultat eZ\Publish\SPI\Persistence\Content\Location

loadByRemoteId() public méthode

Loads the data for the location identified by $remoteId.
public loadByRemoteId ( string $remoteId ) : eZ\Publish\SPI\Persistence\Content\Location
$remoteId string
Résultat eZ\Publish\SPI\Persistence\Content\Location

loadLocationsByContent() public méthode

Loads all locations for $contentId, optionally limited to a sub tree identified by $rootLocationId.
public loadLocationsByContent ( integer $contentId, integer $rootLocationId = null ) : eZ\Publish\SPI\Persistence\Content\Location[]
$contentId integer
$rootLocationId integer
Résultat eZ\Publish\SPI\Persistence\Content\Location[]

loadParentLocationsForDraftContent() public méthode

See also: eZ\Publish\SPI\Persistence\Content\Location\Handler::loadParentLocationsForDraftContent
public loadParentLocationsForDraftContent ( $contentId )

loadSubtreeIds() public méthode

Loads the subtree ids of the location identified by $locationId.
public loadSubtreeIds ( integer $locationId ) : array
$locationId integer
Résultat array Location ids are in the index, Content ids in the value.

markSubtreeModified() public méthode

Optionally a time stamp with the modification date may be specified, otherwise the current time is used.
public markSubtreeModified ( integer | string $locationId, integer $timestamp = null )
$locationId integer | string
$timestamp integer

move() public méthode

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.
public move ( mixed $sourceId, mixed $destinationParentId ) : boolean
$sourceId mixed
$destinationParentId mixed
Résultat boolean

removeSubtree() public méthode

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.
public removeSubtree ( mixed $locationId ) : boolean
$locationId mixed
Résultat boolean

setContentStates() protected méthode

protected setContentStates ( eZ\Publish\SPI\Persistence\Content $content, array $contentStates )
$content eZ\Publish\SPI\Persistence\Content
$contentStates array

setSectionForSubtree() public méthode

Set section on all content objects in the subtree.
public setSectionForSubtree ( mixed $locationId, mixed $sectionId )
$locationId mixed
$sectionId mixed

swap() public méthode

Make the location identified by $locationId1 refer to the Content referred to by $locationId2 and vice versa.
public swap ( mixed $locationId1, mixed $locationId2 ) : boolean
$locationId1 mixed
$locationId2 mixed
Résultat boolean

unHide() public méthode

If not make sure only children down to first hidden node is marked visible.
public unHide ( mixed $id )
$id mixed

update() public méthode

Updates an existing location.
public update ( eZ\Publish\SPI\Persistence\Content\Location\UpdateStruct $location, integer $locationId )
$location eZ\Publish\SPI\Persistence\Content\Location\UpdateStruct
$locationId integer

Property Details

$contentHandler protected_oe property

Content handler.
protected Handler,eZ\Publish\Core\Persistence\Legacy\Content $contentHandler
Résultat eZ\Publish\Core\Persistence\Legacy\Content\Handler

$locationGateway protected_oe property

Gateway for handling location data.
protected Gateway,eZ\Publish\Core\Persistence\Legacy\Content\Location $locationGateway
Résultat Gateway

$locationMapper protected_oe property

Location locationMapper.
protected Mapper,eZ\Publish\Core\Persistence\Legacy\Content\Location $locationMapper
Résultat Mapper

$objectStateHandler protected_oe property

Object state handler.
protected Handler,eZ\Publish\Core\Persistence\Legacy\Content\ObjectState $objectStateHandler
Résultat eZ\Publish\Core\Persistence\Legacy\Content\ObjectState\Handler

$treeHandler protected_oe property

Tree handler.
protected TreeHandler,eZ\Publish\Core\Persistence\Legacy\Content $treeHandler
Résultat eZ\Publish\Core\Persistence\Legacy\Content\TreeHandler