‪TYPO3CMS  ‪main
TYPO3\CMS\Extbase\Persistence\Generic\Session Class Reference

Public Member Functions

 __construct ()
 
 registerReconstitutedEntity (object $entity)
 
 unregisterReconstitutedEntity (object $entity)
 
 getReconstitutedEntities ()
 
 hasObject (object $object)
 
 hasIdentifier (string $identifier, string $className)
 
 getObjectByIdentifier (string $identifier, string $className)
 
non empty string null getIdentifierByObject (object $object)
 
 registerObject (object $object, string $identifier)
 
 unregisterObject (object $object)
 
 destroy ()
 

Protected Member Functions

non empty string getClassIdentifier (string $className)
 

Protected Attributes

ObjectStorage $reconstitutedEntities
 
ObjectStorage $objectMap
 
array $identifierMap = []
 

Detailed Description

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.

Definition at line 26 of file Session.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Extbase\Persistence\Generic\Session::__construct ( )

Constructs a new Session

Definition at line 39 of file Session.php.

Member Function Documentation

◆ destroy()

TYPO3\CMS\Extbase\Persistence\Generic\Session::destroy ( )

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

Definition at line 142 of file Session.php.

◆ getClassIdentifier()

non empty string TYPO3\CMS\Extbase\Persistence\Generic\Session::getClassIdentifier ( string  $className)
protected

Objects are stored in the cache with their implementation class name to allow reusing instances of different classes that point to the same implementation Returns a unique class identifier respecting configured implementation class names

Parameters
class-string$className
Returns
‪non-empty-string

Definition at line 157 of file Session.php.

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\Session\getObjectByIdentifier(), TYPO3\CMS\Extbase\Persistence\Generic\Session\hasIdentifier(), TYPO3\CMS\Extbase\Persistence\Generic\Session\registerObject(), and TYPO3\CMS\Extbase\Persistence\Generic\Session\unregisterObject().

◆ getIdentifierByObject()

non empty string null TYPO3\CMS\Extbase\Persistence\Generic\Session::getIdentifierByObject ( object  $object)

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

Returns
‪non-empty-string|null

Definition at line 110 of file Session.php.

References TYPO3\CMS\Extbase\Persistence\Generic\Session\hasObject().

◆ getObjectByIdentifier()

TYPO3\CMS\Extbase\Persistence\Generic\Session::getObjectByIdentifier ( string  $identifier,
string  $className 
)

Returns the object for the given identifier

Parameters
non-empty-string$identifier
class-string$className

Definition at line 99 of file Session.php.

References TYPO3\CMS\Webhooks\Message\$identifier, and TYPO3\CMS\Extbase\Persistence\Generic\Session\getClassIdentifier().

◆ getReconstitutedEntities()

TYPO3\CMS\Extbase\Persistence\Generic\Session::getReconstitutedEntities ( )

Returns all objects which have been registered as reconstituted

Definition at line 69 of file Session.php.

References TYPO3\CMS\Extbase\Persistence\Generic\Session\$reconstitutedEntities.

◆ hasIdentifier()

TYPO3\CMS\Extbase\Persistence\Generic\Session::hasIdentifier ( string  $identifier,
string  $className 
)

Checks whether the given identifier is known to the identity map

Parameters
non-empty-string$identifier
class-string$className

Definition at line 88 of file Session.php.

References TYPO3\CMS\Webhooks\Message\$identifier, and TYPO3\CMS\Extbase\Persistence\Generic\Session\getClassIdentifier().

◆ hasObject()

TYPO3\CMS\Extbase\Persistence\Generic\Session::hasObject ( object  $object)

Checks whether the given object is known to the identity map

Definition at line 77 of file Session.php.

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\Session\getIdentifierByObject().

◆ registerObject()

TYPO3\CMS\Extbase\Persistence\Generic\Session::registerObject ( object  $object,
string  $identifier 
)

Register an identifier for an object

Parameters
non-empty-string$identifier

Definition at line 123 of file Session.php.

References TYPO3\CMS\Webhooks\Message\$identifier, and TYPO3\CMS\Extbase\Persistence\Generic\Session\getClassIdentifier().

◆ registerReconstitutedEntity()

TYPO3\CMS\Extbase\Persistence\Generic\Session::registerReconstitutedEntity ( object  $entity)

Registers data for a reconstituted object.

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

Definition at line 51 of file Session.php.

◆ unregisterObject()

TYPO3\CMS\Extbase\Persistence\Generic\Session::unregisterObject ( object  $object)

Unregister an object

Definition at line 132 of file Session.php.

References TYPO3\CMS\Extbase\Persistence\Generic\Session\getClassIdentifier().

◆ unregisterReconstitutedEntity()

TYPO3\CMS\Extbase\Persistence\Generic\Session::unregisterReconstitutedEntity ( object  $entity)

Unregisters data for a reconstituted object

Definition at line 59 of file Session.php.

Member Data Documentation

◆ $identifierMap

array TYPO3\CMS\Extbase\Persistence\Generic\Session::$identifierMap = []
protected

Definition at line 34 of file Session.php.

◆ $objectMap

ObjectStorage TYPO3\CMS\Extbase\Persistence\Generic\Session::$objectMap
protected

Definition at line 29 of file Session.php.

◆ $reconstitutedEntities

ObjectStorage TYPO3\CMS\Extbase\Persistence\Generic\Session::$reconstitutedEntities
protected