‪TYPO3CMS  10.4
TYPO3\CMS\Extbase\Persistence\Generic\Session Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\Persistence\Generic\Session:
TYPO3\CMS\Core\SingletonInterface

Public Member Functions

 __construct (Container $container)
 
 registerReconstitutedEntity ($entity)
 
 replaceReconstitutedEntity ($oldEntity, $newEntity)
 
 unregisterReconstitutedEntity ($entity)
 
ObjectStorage getReconstitutedEntities ()
 
bool isReconstitutedEntity ($entity)
 
bool hasObject ($object)
 
bool hasIdentifier ($identifier, $className)
 
object getObjectByIdentifier ($identifier, $className)
 
string getIdentifierByObject ($object)
 
 registerObject ($object, $identifier)
 
 unregisterObject ($object)
 
 destroy ()
 

Protected Member Functions

string getClassIdentifier ($className)
 

Protected Attributes

TYPO3 CMS Extbase Object Container Container $objectContainer
 
ObjectStorage $reconstitutedEntities
 
ObjectStorage $objectMap
 
array $identifierMap = array( )
 

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 ( Container  $container)

Constructs a new Session

Definition at line 49 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 194 of file Session.php.

◆ getClassIdentifier()

string TYPO3\CMS\Extbase\Persistence\Generic\Session::getClassIdentifier (   $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

Parameters
string$className
Returns
‪string a unique class identifier respecting configured implementation class names

Definition at line 208 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()

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

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

Parameters
object$object
Returns
‪string

Definition at line 159 of file Session.php.

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

◆ getObjectByIdentifier()

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

Returns the object for the given identifier

Parameters
string$identifier
string$className
Returns
‪object

Definition at line 146 of file Session.php.

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

◆ getReconstitutedEntities()

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

Returns all objects which have been registered as reconstituted

Returns
ObjectStorage All reconstituted objects

Definition at line 98 of file Session.php.

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

◆ hasIdentifier()

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

Checks whether the given identifier is known to the identity map

Parameters
string$identifier
string$className
Returns
‪bool

Definition at line 134 of file Session.php.

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

◆ hasObject()

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

Checks whether the given object is known to the identity map

Parameters
object$object
Returns
‪bool

Definition at line 122 of file Session.php.

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

◆ isReconstitutedEntity()

bool TYPO3\CMS\Extbase\Persistence\Generic\Session::isReconstitutedEntity (   $entity)

Tells whether the given object is a reconstituted entity.

Parameters
object$entity
Returns
‪bool

Definition at line 109 of file Session.php.

◆ registerObject()

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

Register an identifier for an object

Parameters
object$object
string$identifier

Definition at line 173 of file Session.php.

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

◆ registerReconstitutedEntity()

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

Registers data for a reconstituted object.

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

Parameters
object$entity

Definition at line 64 of file Session.php.

◆ replaceReconstitutedEntity()

TYPO3\CMS\Extbase\Persistence\Generic\Session::replaceReconstitutedEntity (   $oldEntity,
  $newEntity 
)

Replace a reconstituted object, leaves the clean data unchanged.

Parameters
object$oldEntity
object$newEntity

Definition at line 75 of file Session.php.

◆ unregisterObject()

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

Unregister an object

Parameters
object$object

Definition at line 184 of file Session.php.

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

◆ unregisterReconstitutedEntity()

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

Unregisters data for a reconstituted object

Parameters
object$entity

Definition at line 86 of file Session.php.

Member Data Documentation

◆ $identifierMap

array TYPO3\CMS\Extbase\Persistence\Generic\Session::$identifierMap = array( )
protected

Definition at line 44 of file Session.php.

◆ $objectContainer

TYPO3 CMS Extbase Object Container Container TYPO3\CMS\Extbase\Persistence\Generic\Session::$objectContainer
protected

Definition at line 30 of file Session.php.

◆ $objectMap

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

Definition at line 40 of file Session.php.

◆ $reconstitutedEntities

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

Reconstituted objects

Definition at line 36 of file Session.php.

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