2 namespace TYPO3\CMS\Core\Collection;
30 public static function create(array $collectionRecord, $fillItems =
false)
33 $collection = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
34 StaticRecordCollection::class,
35 $collectionRecord[
'table_name']
37 $collection->fromArray($collectionRecord);
39 $collection->loadContents();
52 parent::__construct();
53 if (!empty($tableName)) {
55 }
elseif (empty($this->itemTableName)) {
56 throw new \RuntimeException(\TYPO3\CMS\Core\Collection\StaticRecordCollection::class .
' needs a valid itemTableName.', 1330293778);
76 foreach ($entries as $entry) {
106 public function add($data)
108 $this->storage->push($data);
119 foreach ($other as $value) {
132 public function remove($data)
135 foreach ($this->storage as $value) {
136 if ($value == $data) {
141 $this->storage->offsetUnset($offset);
153 $this->storage = new \SplDoublyLinkedList();
165 $relatedRecords = array();
168 self::$storageTableName,
169 'sys_collection_entries',
171 'AND ' . self::$storageTableName .
'.uid=' . (
int)$this->
getIdentifier()
175 $relatedRecords[] = $record;
179 return $relatedRecords;