‪TYPO3CMS  ‪main
TYPO3\CMS\Frontend\Category\Collection\CategoryCollection Class Reference
Inheritance diagram for TYPO3\CMS\Frontend\Category\Collection\CategoryCollection:
TYPO3\CMS\Core\Category\Collection\CategoryCollection TYPO3\CMS\Core\Collection\AbstractRecordCollection TYPO3\CMS\Core\Collection\EditableCollectionInterface TYPO3\CMS\Core\Collection\RecordCollectionInterface TYPO3\CMS\Core\Collection\RecordCollectionInterface TYPO3\CMS\Core\Collection\PersistableCollectionInterface TYPO3\CMS\Core\Collection\SortableCollectionInterface TYPO3\CMS\Core\Collection\CollectionInterface TYPO3\CMS\Core\Collection\CollectionInterface TYPO3\CMS\Core\Collection\NameableCollectionInterface TYPO3\CMS\Core\Collection\CollectionInterface TYPO3\CMS\Core\Collection\CollectionInterface TYPO3\CMS\Core\Collection\NameableCollectionInterface

Static Public Member Functions

static CategoryCollection create (array $collectionRecord, $fillItems=false)
 
static CategoryCollection load ($id, $fillItems=false, $tableName='', $fieldName='')
 
- ‪Static Public Member Functions inherited from ‪TYPO3\CMS\Core\Category\Collection\CategoryCollection
static string getStorageTableName ()
 
static string getStorageItemsField ()
 
- ‪Static Public Member Functions inherited from ‪TYPO3\CMS\Core\Collection\AbstractRecordCollection
static CollectionInterface load ($id, $fillItems=false)
 

Protected Member Functions

array getCollectedRecords ()
 
- ‪Protected Member Functions inherited from ‪TYPO3\CMS\Core\Category\Collection\CategoryCollection
QueryBuilder getCollectedRecordsQueryBuilder ()
 
array getPersistableDataArray ()
 
- ‪Protected Member Functions inherited from ‪TYPO3\CMS\Core\Collection\AbstractRecordCollection
string getItemUidList ($includeTableName=true)
 

Additional Inherited Members

- ‪Public Member Functions inherited from ‪TYPO3\CMS\Core\Category\Collection\CategoryCollection
 __construct ($tableName=null, $fieldName=null)
 
 loadContents ()
 
 add ($data)
 
 addAll (CollectionInterface $other)
 
 remove ($data)
 
 removeAll ()
 
array getItems ()
 
 setRelationFieldName ($field)
 
string getRelationFieldName ()
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Core\Collection\AbstractRecordCollection
 __construct ()
 
T null current ()
 
 next ()
 
int string key ()
 
bool valid ()
 
 rewind ()
 
 __serialize ()
 
 __unserialize (array $arrayRepresentation)
 
int count ()
 
string getTitle ()
 
int getUid ()
 
string getDescription ()
 
 setTitle ($title)
 
 setDescription ($desc)
 
string getItemTableName ()
 
 setItemTableName ($tableName)
 
 usort ($callbackFunction)
 
 moveItemAt ($currentPosition, $newPosition=0)
 
int getIdentifier ()
 
 setIdentifier ($id)
 
 persist ()
 
array toArray ()
 
 fromArray (array $array)
 
- ‪Static Protected Member Functions inherited from ‪TYPO3\CMS\Core\Collection\AbstractRecordCollection
static getCollectionDatabaseTable ()
 
- ‪Protected Attributes inherited from ‪TYPO3\CMS\Core\Category\Collection\CategoryCollection
string $relationFieldName = 'categories'
 
- ‪Protected Attributes inherited from ‪TYPO3\CMS\Core\Collection\AbstractRecordCollection
int $uid = 0
 
string $title
 
string $description
 
string $itemTableName
 
SplDoublyLinkedList $storage
 
- ‪Static Protected Attributes inherited from ‪TYPO3\CMS\Core\Category\Collection\CategoryCollection
static string $storageTableName = 'sys_category'
 
- ‪Static Protected Attributes inherited from ‪TYPO3\CMS\Core\Collection\AbstractRecordCollection
static string $storageItemsField = 'items'
 
static string $storageTableName = ''
 

Detailed Description

Extend category collection for the frontend, to collect related records while respecting language, enable fields, etc.

this is a concrete TYPO3 hook implementation and solely used for EXT:frontend and not part of TYPO3's Core API.

Definition at line 32 of file CategoryCollection.php.

Member Function Documentation

◆ create()

static CategoryCollection TYPO3\CMS\Frontend\Category\Collection\CategoryCollection::create ( array  $collectionRecord,
  $fillItems = false 
)
static

Creates a new collection objects and reconstitutes the given database record to the new object.

Overrides the parent method to create a frontend category collection.

Parameters
array$collectionRecord‪Database record
bool$fillItems‪Populates the entries directly on load, might be bad for memory on large collections
Returns
CategoryCollection

Reimplemented from TYPO3\CMS\Core\Category\Collection\CategoryCollection.

Definition at line 44 of file CategoryCollection.php.

Referenced by TYPO3\CMS\Frontend\Category\Collection\CategoryCollection\load().

◆ getCollectedRecords()

array TYPO3\CMS\Frontend\Category\Collection\CategoryCollection::getCollectedRecords ( )
protected

Gets the collected records in this collection, by looking up the MM relations of this record to the table name defined in the local field 'table_name'.

Overrides its parent method to implement usage of language, enable fields, etc. Also performs overlays.

Returns
‪array

Reimplemented from TYPO3\CMS\Core\Category\Collection\CategoryCollection.

Definition at line 107 of file CategoryCollection.php.

References $GLOBALS, TYPO3\CMS\Webhooks\Message\$record, TYPO3\CMS\Core\Category\Collection\CategoryCollection\getCollectedRecordsQueryBuilder(), TYPO3\CMS\Core\Collection\AbstractRecordCollection\getItemTableName(), TYPO3\CMS\Core\Database\Connection\PARAM_INT, and TYPO3\CMS\Core\Database\Connection\PARAM_INT_ARRAY.

◆ load()

static CategoryCollection TYPO3\CMS\Frontend\Category\Collection\CategoryCollection::load (   $id,
  $fillItems = false,
  $tableName = '',
  $fieldName = '' 
)
static

Loads the collection with the given id from persistence For memory reasons, only data for the collection itself is loaded by default. Entries can be loaded on first access or straightaway using the $fillItems flag.

Overrides the parent method because of the call to "self::create()" which otherwise calls up \TYPO3\CMS\Core\Category\Collection\CategoryCollection

Parameters
int$id‪Id of database record to be loaded
bool$fillItems‪Populates the entries directly on load, might be bad for memory on large collections
string$tableName‪the table name
string$fieldName‪Name of the categories relation field
Returns
CategoryCollection

Reimplemented from TYPO3\CMS\Core\Category\Collection\CategoryCollection.

Definition at line 72 of file CategoryCollection.php.

References TYPO3\CMS\Frontend\Category\Collection\CategoryCollection\create(), and TYPO3\CMS\Core\Database\Connection\PARAM_INT.

Referenced by TYPO3\CMS\Frontend\ContentObject\Menu\CategoryMenuUtility\collectPages(), and TYPO3\CMS\Frontend\ContentObject\RecordsContentObject\collectRecordsFromCategories().