Session

class \TYPO3\CMS\Extbase\Persistence\Generic\Session

Implements
SingletonInterface

The persistence session - acts as a Unit of Work for Extbase persistence framework.

Table of Contents

Interfaces

SingletonInterface
"empty" interface for singletons (marker interface pattern)

Properties

$identifierMap  : array
$objectContainer  : Container
$objectMap  : ObjectStorage
$reconstitutedEntities  : ObjectStorage
Reconstituted objects

Methods

__construct()  : mixed
Constructs a new Session
destroy()  : mixed
Destroy the state of the persistence session and reset all internal data.
getIdentifierByObject()  : string
Returns the identifier for the given object from the session, if the object was registered.
getObjectByIdentifier()  : object
Returns the object for the given identifier
getReconstitutedEntities()  : ObjectStorage
Returns all objects which have been registered as reconstituted
hasIdentifier()  : bool
Checks whether the given identifier is known to the identity map
hasObject()  : bool
Checks whether the given object is known to the identity map
registerObject()  : mixed
Register an identifier for an object
registerReconstitutedEntity()  : mixed
Registers data for a reconstituted object.
unregisterObject()  : mixed
Unregister an object
unregisterReconstitutedEntity()  : mixed
Unregisters data for a reconstituted object
getClassIdentifier()  : string
Objects are stored in the cache with their implementation class name to allow reusing instances of different classes that point to the same implementation

Properties

$identifierMap

protected array $identifierMap = []

Methods

destroy()

Destroy the state of the persistence session and reset all internal data.

public destroy() : mixed

getIdentifierByObject()

Returns the identifier for the given object from the session, if the object was registered.

public getIdentifierByObject(object $object) : string

Parameters

$object : object

Return values

string

getObjectByIdentifier()

Returns the object for the given identifier

public getObjectByIdentifier(string $identifier, string $className) : object

Parameters

$identifier : string
$className : string

Return values

object

getReconstitutedEntities()

Returns all objects which have been registered as reconstituted

public getReconstitutedEntities() : ObjectStorage

Return values

ObjectStorage —

All reconstituted objects

hasIdentifier()

Checks whether the given identifier is known to the identity map

public hasIdentifier(string $identifier, string $className) : bool

Parameters

$identifier : string
$className : string

Return values

bool

hasObject()

Checks whether the given object is known to the identity map

public hasObject(object $object) : bool

Parameters

$object : object

Return values

bool

registerObject()

Register an identifier for an object

public registerObject(object $object, string $identifier) : mixed

Parameters

$object : object
$identifier : string

registerReconstitutedEntity()

Registers data for a reconstituted object.

public registerReconstitutedEntity(object $entity) : mixed

$entityData format is described in "Documentation/PersistenceFramework object data format.txt"

Parameters

$entity : object

unregisterObject()

Unregister an object

public unregisterObject(object $object) : mixed

Parameters

$object : object

unregisterReconstitutedEntity()

Unregisters data for a reconstituted object

public unregisterReconstitutedEntity(object $entity) : mixed

Parameters

$entity : object

getClassIdentifier()

Objects are stored in the cache with their implementation class name to allow reusing instances of different classes that point to the same implementation

protected getClassIdentifier(string $className) : string

Parameters

$className : string

Return values

string —

a unique class identifier respecting configured implementation class names

On this page