Session implements SingletonInterface
The persistence session - acts as a Unit of Work for Extbase persistence framework.
only to be used within Extbase, not part of TYPO3 Core API.
Table of Contents
Interfaces
- SingletonInterface
- "empty" interface for singletons (marker interface pattern)
Properties
- $identifierMap : array<string|int, mixed>
- $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<string|int, mixed>
$identifierMap
= []
$objectContainer
protected
Container
$objectContainer
$objectMap
protected
ObjectStorage
$objectMap
$reconstitutedEntities
Reconstituted objects
protected
ObjectStorage
$reconstitutedEntities
Methods
__construct()
Constructs a new Session
public
__construct(Container $container) : mixed
Parameters
- $container : Container
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
stringgetObjectByIdentifier()
Returns the object for the given identifier
public
getObjectByIdentifier(string $identifier, string $className) : object
Parameters
- $identifier : string
- $className : string
Return values
objectgetReconstitutedEntities()
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
boolhasObject()
Checks whether the given object is known to the identity map
public
hasObject(object $object) : bool
Parameters
- $object : object
Return values
boolregisterObject()
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