‪TYPO3CMS  10.4
TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage:
TYPO3\CMS\Extbase\Persistence\ObjectStorage TYPO3\CMS\Extbase\Persistence\Generic\LoadingStrategyInterface TYPO3\CMS\Extbase\Persistence\ObjectMonitoringInterface

Public Member Functions

 injectObjectManager (ObjectManagerInterface $objectManager)
 
bool isInitialized ()
 
 __construct ($parentObject, $propertyName, $fieldValue, ?DataMapper $dataMapper=null)
 
 initializeObject ()
 
 addAll (ObjectStorage $storage)
 
 attach ($object, $data=null)
 
bool contains ($object)
 
int count ()
 
DomainObjectInterface current ()
 
 detach ($object)
 
string key ()
 
 next ()
 
bool offsetExists ($value)
 
mixed offsetGet ($value)
 
 offsetSet ($object, $info)
 
 offsetUnset ($value)
 
 removeAll (ObjectStorage $storage)
 
 rewind ()
 
bool valid ()
 
array toArray ()
 
int null getPosition ($object)
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Extbase\Persistence\ObjectStorage
mixed getInfo ()
 
 setInfo ($data)
 
array getArray ()
 
 serialize ()
 
 unserialize ()
 
 _memorizeCleanState ()
 
bool _isDirty ()
 
bool isRelationDirty ($object)
 

Protected Member Functions

 initialize ()
 
bool isStorageAlreadyMemorizedInParentCleanState ()
 

Protected Attributes

DataMapper null $dataMapper
 
TYPO3 CMS Extbase DomainObject DomainObjectInterface $parentObject
 
string $propertyName
 
mixed $fieldValue
 
bool $isInitialized = false
 
ObjectManagerInterface $objectManager
 
- ‪Protected Attributes inherited from ‪TYPO3\CMS\Extbase\Persistence\ObjectStorage
array $storage = array( )
 
bool $isModified = false
 
array $addedObjectsPositions = array( )
 
array $removedObjectsPositions = array( )
 
int $positionCounter = 0
 

Private Attributes

string $warning = 'You should never see this warning. If you do, you probably used PHP array functions like current() on the TYPO3\\CMS\\Extbase\\Persistence\\Generic\\LazyObjectStorage. To retrieve the first result, you can use the rewind() and current() methods.'
 

Detailed Description

A proxy that can replace any object and replaces itself in it's parent on first access (call, get, set, isset, unset).

only to be used within Extbase, not part of TYPO3 Core API.

Definition at line 29 of file LazyObjectStorage.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::__construct (   $parentObject,
  $propertyName,
  $fieldValue,
?DataMapper  $dataMapper = null 
)

Constructs this proxy instance.

Parameters
DomainObjectInterface$parentObject‪The object instance this proxy is part of
string$propertyName‪The name of the proxied property in it's parent
mixed$fieldValue‪The raw field value.
?DataMapper‪$dataMapper

Definition at line 96 of file LazyObjectStorage.php.

References TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\$dataMapper, TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\$fieldValue, TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\$parentObject, and TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\$propertyName.

Member Function Documentation

◆ addAll()

TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::addAll ( ObjectStorage  $storage)
Parameters
\TYPO3\CMS\Extbase\Persistence\ObjectStorage$storage
See also
‪\TYPO3\CMS\Extbase\Persistence\ObjectStorage::addAll

Reimplemented from TYPO3\CMS\Extbase\Persistence\ObjectStorage.

Definition at line 147 of file LazyObjectStorage.php.

References TYPO3\CMS\Extbase\Persistence\ObjectStorage\$storage, and TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\initialize().

◆ attach()

TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::attach (   $object,
  $data = null 
)
Parameters
DomainObjectInterface$object‪The object to add.
mixed$data‪The data to associate with the object.
See also
‪\TYPO3\CMS\Extbase\Persistence\ObjectStorage::attach

Reimplemented from TYPO3\CMS\Extbase\Persistence\ObjectStorage.

Definition at line 159 of file LazyObjectStorage.php.

References TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\initialize().

◆ contains()

bool TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::contains (   $object)
Parameters
DomainObjectInterface$object‪The object to look for.
Returns
‪bool
See also
‪\TYPO3\CMS\Extbase\Persistence\ObjectStorage::contains

Reimplemented from TYPO3\CMS\Extbase\Persistence\ObjectStorage.

Definition at line 171 of file LazyObjectStorage.php.

References TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\initialize().

◆ count()

int TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::count ( )

◆ current()

DomainObjectInterface TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::current ( )
Returns
‪DomainObjectInterface The object at the current iterator position.
See also
‪\TYPO3\CMS\Extbase\Persistence\ObjectStorage::current

Reimplemented from TYPO3\CMS\Extbase\Persistence\ObjectStorage.

Definition at line 204 of file LazyObjectStorage.php.

References TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\initialize().

◆ detach()

TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::detach (   $object)
Parameters
DomainObjectInterface$object‪The object to remove.
See also
‪\TYPO3\CMS\Extbase\Persistence\ObjectStorage::detach

Reimplemented from TYPO3\CMS\Extbase\Persistence\ObjectStorage.

Definition at line 215 of file LazyObjectStorage.php.

References TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\initialize().

◆ getPosition()

int null TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::getPosition (   $object)
Parameters
mixed$object
Returns
‪int|null

Reimplemented from TYPO3\CMS\Extbase\Persistence\ObjectStorage.

Definition at line 334 of file LazyObjectStorage.php.

References TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\initialize().

◆ initialize()

TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::initialize ( )
protected

This is a function lazy load implementation.

Definition at line 118 of file LazyObjectStorage.php.

References TYPO3\CMS\Extbase\Persistence\ObjectStorage\_memorizeCleanState(), TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\isInitialized(), and TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\isStorageAlreadyMemorizedInParentCleanState().

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\addAll(), TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\attach(), TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\contains(), TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\count(), TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\current(), TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\detach(), TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\getPosition(), TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\key(), TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\next(), TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\offsetExists(), TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\offsetGet(), TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\offsetSet(), TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\offsetUnset(), TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\removeAll(), TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\rewind(), TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\toArray(), and TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\valid().

◆ initializeObject()

TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::initializeObject ( )

Object initialization called when object is created with ObjectManager, after constructor

Definition at line 108 of file LazyObjectStorage.php.

◆ injectObjectManager()

TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::injectObjectManager ( ObjectManagerInterface  $objectManager)
Parameters
ObjectManagerInterface$objectManager

Definition at line 73 of file LazyObjectStorage.php.

References TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\$objectManager.

◆ isInitialized()

bool TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::isInitialized ( )

◆ isStorageAlreadyMemorizedInParentCleanState()

bool TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::isStorageAlreadyMemorizedInParentCleanState ( )
protected
Returns
‪bool

Definition at line 136 of file LazyObjectStorage.php.

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\initialize().

◆ key()

string TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::key ( )
Returns
‪string The index corresponding to the position of the iterator.
See also
‪\TYPO3\CMS\Extbase\Persistence\ObjectStorage::key

Reimplemented from TYPO3\CMS\Extbase\Persistence\ObjectStorage.

Definition at line 226 of file LazyObjectStorage.php.

References TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\initialize().

◆ next()

TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::next ( )
See also
‪\TYPO3\CMS\Extbase\Persistence\ObjectStorage::next

Reimplemented from TYPO3\CMS\Extbase\Persistence\ObjectStorage.

Definition at line 235 of file LazyObjectStorage.php.

References TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\initialize().

◆ offsetExists()

bool TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::offsetExists (   $value)
Parameters
DomainObjectInterface$value‪The object to look for, or the key in the storage.
Returns
‪bool
See also
‪\TYPO3\CMS\Extbase\Persistence\ObjectStorage::offsetExists

Reimplemented from TYPO3\CMS\Extbase\Persistence\ObjectStorage.

Definition at line 247 of file LazyObjectStorage.php.

References TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\initialize().

◆ offsetGet()

mixed TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::offsetGet (   $value)
Parameters
DomainObjectInterface$value‪The object to look for, or its key in the storage.
Returns
‪mixed
See also
‪\TYPO3\CMS\Extbase\Persistence\ObjectStorage::offsetGet

Reimplemented from TYPO3\CMS\Extbase\Persistence\ObjectStorage.

Definition at line 259 of file LazyObjectStorage.php.

References TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\initialize().

◆ offsetSet()

TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::offsetSet (   $object,
  $info 
)
Parameters
DomainObjectInterface$object‪The object to add.
mixed$info‪The data to associate with the object.
See also
‪\TYPO3\CMS\Extbase\Persistence\ObjectStorage::offsetSet

Reimplemented from TYPO3\CMS\Extbase\Persistence\ObjectStorage.

Definition at line 271 of file LazyObjectStorage.php.

References TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\initialize().

◆ offsetUnset()

TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::offsetUnset (   $value)
Parameters
DomainObjectInterface$value‪The object to remove, or its key in the storage.
See also
‪\TYPO3\CMS\Extbase\Persistence\ObjectStorage::offsetUnset

Reimplemented from TYPO3\CMS\Extbase\Persistence\ObjectStorage.

Definition at line 282 of file LazyObjectStorage.php.

References TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\initialize().

◆ removeAll()

TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::removeAll ( ObjectStorage  $storage)
Parameters
\TYPO3\CMS\Extbase\Persistence\ObjectStorage$storage‪The storage containing the elements to remove.
See also
‪\TYPO3\CMS\Extbase\Persistence\ObjectStorage::removeAll

Reimplemented from TYPO3\CMS\Extbase\Persistence\ObjectStorage.

Definition at line 293 of file LazyObjectStorage.php.

References TYPO3\CMS\Extbase\Persistence\ObjectStorage\$storage, and TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\initialize().

◆ rewind()

TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::rewind ( )
See also
‪\TYPO3\CMS\Extbase\Persistence\ObjectStorage::rewind

Reimplemented from TYPO3\CMS\Extbase\Persistence\ObjectStorage.

Definition at line 302 of file LazyObjectStorage.php.

References TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\initialize().

◆ toArray()

array TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::toArray ( )
Returns
‪array
See also
‪\TYPO3\CMS\Extbase\Persistence\ObjectStorage::toArray

Reimplemented from TYPO3\CMS\Extbase\Persistence\ObjectStorage.

Definition at line 324 of file LazyObjectStorage.php.

References TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\initialize().

◆ valid()

bool TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::valid ( )
Returns
‪bool
See also
‪\TYPO3\CMS\Extbase\Persistence\ObjectStorage::valid

Reimplemented from TYPO3\CMS\Extbase\Persistence\ObjectStorage.

Definition at line 313 of file LazyObjectStorage.php.

References TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\initialize().

Member Data Documentation

◆ $dataMapper

DataMapper null TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::$dataMapper
protected

◆ $fieldValue

mixed TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::$fieldValue
protected

The raw field value.

Definition at line 60 of file LazyObjectStorage.php.

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\__construct().

◆ $isInitialized

bool TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::$isInitialized = false
protected

◆ $objectManager

ObjectManagerInterface TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::$objectManager
protected

◆ $parentObject

TYPO3 CMS Extbase DomainObject DomainObjectInterface TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::$parentObject
protected

The object this property is contained in.

Definition at line 48 of file LazyObjectStorage.php.

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\__construct().

◆ $propertyName

string TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::$propertyName
protected

The name of the property represented by this proxy.

Definition at line 54 of file LazyObjectStorage.php.

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage\__construct().

◆ $warning

string TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::$warning = 'You should never see this warning. If you do, you probably used PHP array functions like current() on the TYPO3\\CMS\\Extbase\\Persistence\\Generic\\LazyObjectStorage. To retrieve the first result, you can use the rewind() and current() methods.'
private

This field is only needed to make debugging easier: If you call current() on a class that implements Iterator, PHP will return the first field of the object instead of calling the current() method of the interface. We use this unusual behavior of PHP to return the warning below in this case.

Definition at line 38 of file LazyObjectStorage.php.