TYPO3 CMS  TYPO3_7-6
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\PersistableCollectionInterface TYPO3\CMS\Core\Collection\SortableCollectionInterface TYPO3\CMS\Core\Collection\CollectionInterface TYPO3\CMS\Core\Collection\NameableCollectionInterface

Static Public Member Functions

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

Protected Member Functions

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

Static Protected Member Functions

static getTypoScriptFrontendController ()
 
static getDatabaseConnection ()
 
- Static Protected Member Functions inherited from TYPO3\CMS\Core\Category\Collection\CategoryCollection
static getDatabaseConnection ()
 

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 ()
 
 setRelationFieldName ($field)
 
 getRelationFieldName ()
 
- Public Member Functions inherited from TYPO3\CMS\Core\Collection\AbstractRecordCollection
 __construct ()
 
 current ()
 
 next ()
 
 key ()
 
 valid ()
 
 rewind ()
 
 serialize ()
 
 unserialize ($serialized)
 
 count ()
 
 getTitle ()
 
 getUid ()
 
 getDescription ()
 
 setTitle ($title)
 
 setDescription ($desc)
 
 getItemTableName ()
 
 setItemTableName ($tableName)
 
 usort ($callbackFunction)
 
 moveItemAt ($currentPosition, $newPosition=0)
 
 getIdentifier ()
 
 setIdentifier ($id)
 
 toArray ()
 
 fromArray (array $array)
 
- Public Member Functions inherited from TYPO3\CMS\Core\Collection\PersistableCollectionInterface
 persist ()
 
- Protected Attributes inherited from TYPO3\CMS\Core\Category\Collection\CategoryCollection
 $relationFieldName = 'categories'
 
- Protected Attributes inherited from TYPO3\CMS\Core\Collection\AbstractRecordCollection
 $uid = 0
 
 $title
 
 $description
 
 $itemTableName
 
 $storage
 
- Static Protected Attributes inherited from TYPO3\CMS\Core\Category\Collection\CategoryCollection
static $storageTableName = 'sys_category'
 
- Static Protected Attributes inherited from TYPO3\CMS\Core\Collection\AbstractRecordCollection
static $storageTableName = 'sys_collection'
 
static $storageItemsField = 'items'
 

Detailed Description

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

Definition at line 23 of file CategoryCollection.php.

Member Function Documentation

◆ getCollectedRecords()

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

Definition at line 85 of file CategoryCollection.php.

References $GLOBALS, TYPO3\CMS\Core\Collection\AbstractRecordCollection\getIdentifier(), TYPO3\CMS\Core\Collection\AbstractRecordCollection\getItemTableName(), and TYPO3\CMS\Core\Category\Collection\CategoryCollection\getRelationFieldName().

◆ getDatabaseConnection()

static TYPO3\CMS\Frontend\Category\Collection\CategoryCollection::getDatabaseConnection ( )
staticprotected

Returns the database connection

Returns

Definition at line 174 of file CategoryCollection.php.

References $GLOBALS.

◆ getTypoScriptFrontendController()

static TYPO3\CMS\Frontend\Category\Collection\CategoryCollection::getTypoScriptFrontendController ( )
staticprotected

Gets the TSFE object.

Returns

Definition at line 164 of file CategoryCollection.php.

References $GLOBALS.

◆ load()

static 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

Parameters
int$idId of database record to be loaded
bool$fillItemsPopulates the entries directly on load, might be bad for memory on large collections
string$tableNamethe table name
string$fieldNameName of the categories relation field
Returns

Definition at line 63 of file CategoryCollection.php.

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