TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
LazyObjectStorage Class Reference
Inheritance diagram for LazyObjectStorage:
ObjectStorage LoadingStrategyInterface ObjectMonitoringInterface

Public Member Functions

 injectDataMapper (\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper $dataMapper)
 
 isInitialized ()
 
 __construct ($parentObject, $propertyName, $fieldValue)
 
 addAll (\TYPO3\CMS\Extbase\Persistence\ObjectStorage $storage)
 
 attach ($object, $data=null)
 
 contains ($object)
 
 count ()
 
 current ()
 
 detach ($object)
 
 key ()
 
 next ()
 
 offsetExists ($object)
 
 offsetGet ($object)
 
 offsetSet ($object, $info)
 
 offsetUnset ($object)
 
 removeAll (\TYPO3\CMS\Extbase\Persistence\ObjectStorage $storage)
 
 rewind ()
 
 valid ()
 
 toArray ()
 
 getPosition ($object)
 
- Public Member Functions inherited from ObjectStorage
 rewind ()
 
 valid ()
 
 key ()
 
 current ()
 
 next ()
 
 count ()
 
 offsetSet ($object, $information)
 
 offsetExists ($object)
 
 offsetUnset ($object)
 
 offsetGet ($object)
 
 contains ($object)
 
 attach ($object, $information=null)
 
 detach ($object)
 
 getInfo ()
 
 setInfo ($data)
 
 addAll (ObjectStorage $objectStorage)
 
 removeAll (ObjectStorage $objectStorage)
 
 toArray ()
 
 getArray ()
 
 serialize ()
 
 unserialize ($serialized)
 
 _memorizeCleanState ()
 
 _isDirty ()
 
 isRelationDirty ($object)
 
 getPosition ($object)
 

Protected Member Functions

 initialize ()
 
 isStorageAlreadyMemorizedInParentCleanState ()
 

Protected Attributes

 $dataMapper
 
 $parentObject
 
 $propertyName
 
 $fieldValue
 
 $isInitialized = false
 
- Protected Attributes inherited from ObjectStorage
 $storage = []
 
 $isModified = false
 
 $addedObjectsPositions = []
 
 $removedObjectsPositions = []
 
 $positionCounter = 0
 

Private Attributes

 $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).

Definition at line 23 of file LazyObjectStorage.php.

Constructor & Destructor Documentation

__construct (   $parentObject,
  $propertyName,
  $fieldValue 
)

Constructs this proxy instance.

Parameters
DomainObjectInterface$parentObjectThe object instance this proxy is part of
string$propertyNameThe name of the proxied property in it's parent
mixed$fieldValueThe raw field value.

Definition at line 91 of file LazyObjectStorage.php.

References LazyObjectStorage\$fieldValue, LazyObjectStorage\$parentObject, and LazyObjectStorage\$propertyName.

Member Function Documentation

Parameters
\TYPO3\CMS\Extbase\Persistence\ObjectStorage$storage
See also
::addAll

Definition at line 133 of file LazyObjectStorage.php.

References LazyObjectStorage\initialize().

attach (   $object,
  $data = null 
)
Parameters
object$objectThe object to add.
mixed$dataThe data to associate with the object.
See also
::attach

Definition at line 145 of file LazyObjectStorage.php.

References LazyObjectStorage\initialize().

contains (   $object)
Parameters
object$objectThe object to look for.
Returns
bool
See also
::contains

Definition at line 157 of file LazyObjectStorage.php.

References LazyObjectStorage\initialize().

count ( )

Counts the elements in the storage array

Exceptions
Exception
Returns
int The number of elements in the ObjectStorage

Definition at line 169 of file LazyObjectStorage.php.

References LazyObjectStorage\initialize(), LazyObjectStorage\isInitialized(), and ColumnMap\RELATION_HAS_MANY.

current ( )
Returns
object The object at the current iterator position.
See also
::current

Definition at line 190 of file LazyObjectStorage.php.

References LazyObjectStorage\initialize().

detach (   $object)
Parameters
object$objectThe object to remove.
See also
::detach

Definition at line 201 of file LazyObjectStorage.php.

References LazyObjectStorage\initialize().

getPosition (   $object)
Parameters
mixed$object
Returns
int|NULL

Definition at line 322 of file LazyObjectStorage.php.

References LazyObjectStorage\initialize().

injectDataMapper ( \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper  $dataMapper)
Parameters
\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper$dataMapper

Definition at line 69 of file LazyObjectStorage.php.

References LazyObjectStorage\$dataMapper.

isInitialized ( )

Returns the state of the initialization

Returns
bool

Definition at line 79 of file LazyObjectStorage.php.

References LazyObjectStorage\$isInitialized.

Referenced by LazyObjectStorage\count(), and LazyObjectStorage\initialize().

isStorageAlreadyMemorizedInParentCleanState ( )
protected
Returns
bool

Definition at line 122 of file LazyObjectStorage.php.

Referenced by LazyObjectStorage\initialize().

key ( )
Returns
string The index corresponding to the position of the iterator.
See also
::key

Definition at line 212 of file LazyObjectStorage.php.

References LazyObjectStorage\initialize().

next ( )
See also
::next

Definition at line 221 of file LazyObjectStorage.php.

References LazyObjectStorage\initialize().

offsetExists (   $object)
Parameters
object$objectThe object to look for.
Returns
bool
See also
::offsetExists

Definition at line 233 of file LazyObjectStorage.php.

References LazyObjectStorage\initialize().

offsetGet (   $object)
Parameters
object$objectThe object to look for.
Returns
mixed
See also
::offsetGet

Definition at line 245 of file LazyObjectStorage.php.

References LazyObjectStorage\initialize().

offsetSet (   $object,
  $info 
)
Parameters
object$objectThe object to add.
mixed$infoThe data to associate with the object.
See also
::offsetSet

Definition at line 257 of file LazyObjectStorage.php.

References LazyObjectStorage\initialize().

offsetUnset (   $object)
Parameters
object$objectThe object to remove.
Returns
void
See also
::offsetUnset

Definition at line 269 of file LazyObjectStorage.php.

References LazyObjectStorage\initialize().

Parameters
\TYPO3\CMS\Extbase\Persistence\ObjectStorage$storageThe storage containing the elements to remove.
Returns
void
See also
::removeAll

Definition at line 281 of file LazyObjectStorage.php.

References LazyObjectStorage\initialize().

rewind ( )
See also
::rewind

Definition at line 290 of file LazyObjectStorage.php.

References LazyObjectStorage\initialize().

toArray ( )
Returns
array
See also
::toArray

Definition at line 312 of file LazyObjectStorage.php.

References LazyObjectStorage\initialize().

valid ( )
Returns
bool
See also
::valid

Definition at line 301 of file LazyObjectStorage.php.

References LazyObjectStorage\initialize().

Member Data Documentation

$dataMapper
protected

Definition at line 38 of file LazyObjectStorage.php.

Referenced by LazyObjectStorage\injectDataMapper().

$fieldValue
protected

Definition at line 59 of file LazyObjectStorage.php.

Referenced by LazyObjectStorage\__construct().

$isInitialized = false
protected

Definition at line 64 of file LazyObjectStorage.php.

Referenced by LazyObjectStorage\isInitialized().

$parentObject
protected

Definition at line 45 of file LazyObjectStorage.php.

Referenced by LazyObjectStorage\__construct().

$propertyName
protected

Definition at line 52 of file LazyObjectStorage.php.

Referenced by LazyObjectStorage\__construct().

$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

Definition at line 33 of file LazyObjectStorage.php.