‪TYPO3CMS  11.5
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\ObjectStorage TYPO3\CMS\Extbase\Persistence\Generic\LoadingStrategyInterface TYPO3\CMS\Extbase\Persistence\ObjectMonitoringInterface TYPO3\CMS\Extbase\Persistence\ObjectMonitoringInterface

Public Member Functions

bool isInitialized ()
 
 __construct ($parentObject, $propertyName, $fieldValue, ?DataMapper $dataMapper=null)
 
 addAll (ObjectStorage $storage)
 
 attach ($object, $data=null)
 
bool contains ($object)
 
int count ()
 
TEntity null 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)
 
 __serialize ()
 
 __unserialize (array $data)
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Extbase\Persistence\ObjectStorage
mixed getInfo ()
 
 setInfo ($data)
 
list< TEntity > getArray ()
 
 serialize ()
 
 unserialize ()
 
 _memorizeCleanState ()
 
bool _isDirty ()
 
bool isRelationDirty ($object)
 

Protected Member Functions

 initialize ()
 
bool isStorageAlreadyMemorizedInParentCleanState ()
 

Protected Attributes

DataMapper $dataMapper
 
TYPO3 CMS Extbase DomainObject DomainObjectInterface $parentObject
 
string $propertyName
 
mixed $fieldValue
 
bool $isInitialized = false
 
- ‪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.

@template TEntity <TEntity>

Definition at line 31 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
TEntity$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 | null$dataMapper

Definition at line 84 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

◆ __serialize()

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

Definition at line 321 of file LazyObjectStorage.php.

◆ __unserialize()

TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::__unserialize ( array  $data)

◆ 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 130 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
TEntity$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 142 of file LazyObjectStorage.php.

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

◆ contains()

bool TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::contains (   $object)
Parameters
TEntity$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 154 of file LazyObjectStorage.php.

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

◆ count()

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

◆ current()

TEntity null TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::current ( )
Returns
‪TEntity|null 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 184 of file LazyObjectStorage.php.

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

◆ detach()

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

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

Definition at line 195 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 315 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 99 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().

◆ isInitialized()

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

◆ isStorageAlreadyMemorizedInParentCleanState()

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

Definition at line 119 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 206 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 215 of file LazyObjectStorage.php.

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

◆ offsetExists()

bool TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::offsetExists (   $value)
Parameters
TEntity$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 227 of file LazyObjectStorage.php.

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

◆ offsetGet()

mixed TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::offsetGet (   $value)
Parameters
TEntity$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 240 of file LazyObjectStorage.php.

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

◆ offsetSet()

TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::offsetSet (   $object,
  $info 
)
Parameters
TEntity$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 252 of file LazyObjectStorage.php.

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

◆ offsetUnset()

TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage::offsetUnset (   $value)
Parameters
TEntity$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 263 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 274 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 283 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 305 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 294 of file LazyObjectStorage.php.

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

Member Data Documentation

◆ $dataMapper

DataMapper 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

◆ $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

◆ $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 40 of file LazyObjectStorage.php.