2 namespace TYPO3\CMS\Extbase\Persistence\Generic;
33 private $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.';
96 reset($this->storage);
108 $objects = $this->dataMapper->fetchRelated($this->parentObject, $this->propertyName, $this->fieldValue,
false);
109 foreach ($objects as $object) {
110 parent::attach($object);
114 $this->parentObject->_memorizeCleanState($this->propertyName);
124 return $this->parentObject->_getCleanProperty($this->propertyName) === $this;
136 parent::addAll($storage);
145 public function attach($object, $data = null)
148 parent::attach($object, $data);
160 return parent::contains($object);
171 $columnMap = $this->dataMapper->getDataMap(get_class($this->parentObject))->getColumnMap($this->propertyName);
172 $numberOfElements = null;
173 if (!$this->
isInitialized && $columnMap->getTypeOfRelation() === Mapper\ColumnMap::RELATION_HAS_MANY) {
174 $numberOfElements = $this->dataMapper->countRelated($this->parentObject, $this->propertyName, $this->fieldValue);
177 $numberOfElements =
count($this->storage);
179 if (is_null($numberOfElements)) {
180 throw new \TYPO3\CMS\Extbase\Persistence\Generic\Exception(
'The number of elements could not be determined.', 1252514486);
182 return $numberOfElements;
193 return parent::current();
204 parent::detach($object);
215 return parent::key();
236 return parent::offsetExists($object);
248 return parent::offsetGet($object);
260 parent::offsetSet($object, $info);
272 parent::offsetUnset($object);
284 parent::removeAll($storage);
304 return parent::valid();
315 return parent::toArray();
325 return parent::getPosition($object);