TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Core\Collection\AbstractRecordCollection Class Reference
Inheritance diagram for TYPO3\CMS\Core\Collection\AbstractRecordCollection:
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 TYPO3\CMS\Core\Category\Collection\CategoryCollection TYPO3\CMS\Core\Collection\StaticRecordCollection TYPO3\CMS\Core\Resource\Collection\AbstractFileCollection TYPO3\CMS\Frontend\Category\Collection\CategoryCollection TYPO3\CMS\Core\Resource\Collection\CategoryBasedFileCollection TYPO3\CMS\Core\Resource\Collection\FolderBasedFileCollection TYPO3\CMS\Core\Resource\Collection\StaticFileCollection

Public Member Functions

 __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 ()
 
 loadContents ()
 

Static Public Member Functions

static load ($id, $fillItems=false)
 
static create (array $collectionRecord, $fillItems=false)
 

Protected Member Functions

 getPersistableDataArray ()
 
 getItemUidList ($includeTableName=true)
 

Protected Attributes

 $uid = 0
 
 $title
 
 $description
 
 $itemTableName
 
 $storage
 

Static Protected Attributes

static $storageTableName = 'sys_collection'
 
static $storageItemsField = 'items'
 

Detailed Description

Abstract implementation of a RecordCollection

RecordCollection is a collections of TCA-Records. The collection is meant to be stored in TCA-table sys_collections and is manageable via TCEforms.

A RecordCollection might be used to group a set of records (e.g. news, images, contentElements) for output in frontend

The AbstractRecordCollection uses SplDoublyLinkedList for internal storage

Definition at line 29 of file AbstractRecordCollection.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Collection\AbstractRecordCollection::__construct ( )

Creates this object.

Definition at line 83 of file AbstractRecordCollection.php.

Member Function Documentation

◆ count()

TYPO3\CMS\Core\Collection\AbstractRecordCollection::count ( )

(PHP 5 >= 5.1.0) Count elements of an object

int The custom count as an integer.

Definition at line 185 of file AbstractRecordCollection.php.

◆ create()

◆ current()

TYPO3\CMS\Core\Collection\AbstractRecordCollection::current ( )

(PHP 5 >= 5.1.0) Return the current element

mixed Can return any type.

Definition at line 95 of file AbstractRecordCollection.php.

◆ fromArray()

TYPO3\CMS\Core\Collection\AbstractRecordCollection::fromArray ( array  $array)

Loads the properties of this collection from an array

Parameters
array$array
Returns
void

Definition at line 433 of file AbstractRecordCollection.php.

◆ getDescription()

◆ getIdentifier()

◆ getItemTableName()

◆ getItemUidList()

TYPO3\CMS\Core\Collection\AbstractRecordCollection::getItemUidList (   $includeTableName = true)
protected

Generates comma-separated list of entry uids for usage in TCEmain

also allow to add table name, if it might be needed by TCEmain for storing the relation

Parameters
bool$includeTableName
Returns
string

Definition at line 398 of file AbstractRecordCollection.php.

References TYPO3\CMS\Core\Collection\AbstractRecordCollection\getItemTableName().

Referenced by TYPO3\CMS\Core\Collection\StaticRecordCollection\getPersistableDataArray(), TYPO3\CMS\Core\Category\Collection\CategoryCollection\getPersistableDataArray(), and TYPO3\CMS\Core\Resource\Collection\AbstractFileCollection\setTitle().

◆ getPersistableDataArray()

TYPO3\CMS\Core\Collection\AbstractRecordCollection::getPersistableDataArray ( )
abstractprotected

Returns an array of the persistable properties and contents which are processable by TCEmain.

For internal usage in persist only.

Returns
array

Referenced by TYPO3\CMS\Core\Collection\AbstractRecordCollection\create().

◆ getTitle()

◆ getUid()

TYPO3\CMS\Core\Collection\AbstractRecordCollection::getUid ( )

Getter for the UID

Returns
int

Definition at line 205 of file AbstractRecordCollection.php.

References TYPO3\CMS\Core\Collection\AbstractRecordCollection\$uid.

◆ key()

TYPO3\CMS\Core\Collection\AbstractRecordCollection::key ( )

(PHP 5 >= 5.1.0) Return the key of the current element

int 0 on failure.

Definition at line 119 of file AbstractRecordCollection.php.

Referenced by TYPO3\CMS\Core\Resource\Collection\AbstractFileCollection\setTitle().

◆ load()

static TYPO3\CMS\Core\Collection\AbstractRecordCollection::load (   $id,
  $fillItems = false 
)
static

Loads the collections with the given id from persistence

For memory reasons, per default only f.e. title, database-table, identifier (what ever static data is defined) is loaded. Entries can be load on first access.

Parameters
int$idId of database record to be loaded
bool$fillItemsPopulates the entries directly on load, might be bad for memory on large collections
Returns

Implements TYPO3\CMS\Core\Collection\PersistableCollectionInterface.

Definition at line 327 of file AbstractRecordCollection.php.

References $GLOBALS, and TYPO3\CMS\Backend\Utility\BackendUtility\deleteClause().

◆ moveItemAt()

TYPO3\CMS\Core\Collection\AbstractRecordCollection::moveItemAt (   $currentPosition,
  $newPosition = 0 
)

Moves the item within the collection

the item at $currentPosition will be moved to $newPosition. Omiting $newPosition will move to top.

Parameters
int$currentPosition
int$newPosition
Returns
void

Implements TYPO3\CMS\Core\Collection\SortableCollectionInterface.

Definition at line 289 of file AbstractRecordCollection.php.

◆ next()

TYPO3\CMS\Core\Collection\AbstractRecordCollection::next ( )

(PHP 5 >= 5.1.0) Move forward to next element

void Any returned value is ignored.

Definition at line 107 of file AbstractRecordCollection.php.

◆ rewind()

TYPO3\CMS\Core\Collection\AbstractRecordCollection::rewind ( )

(PHP 5 >= 5.1.0) Rewind the Iterator to the first element

void Any returned value is ignored.

Definition at line 144 of file AbstractRecordCollection.php.

◆ serialize()

TYPO3\CMS\Core\Collection\AbstractRecordCollection::serialize ( )

◆ setDescription()

TYPO3\CMS\Core\Collection\AbstractRecordCollection::setDescription (   $desc)

Setter for the description

Parameters
string$desc
Returns
void

Implements TYPO3\CMS\Core\Collection\NameableCollectionInterface.

Definition at line 237 of file AbstractRecordCollection.php.

◆ setIdentifier()

TYPO3\CMS\Core\Collection\AbstractRecordCollection::setIdentifier (   $id)

Sets the identifier of the collection

Parameters
int$id
Returns
void

Implements TYPO3\CMS\Core\Collection\PersistableCollectionInterface.

Definition at line 311 of file AbstractRecordCollection.php.

◆ setItemTableName()

TYPO3\CMS\Core\Collection\AbstractRecordCollection::setItemTableName (   $tableName)

Setter for the name of the data-source table

Parameters
string$tableName
Returns
void

Implements TYPO3\CMS\Core\Collection\RecordCollectionInterface.

Definition at line 258 of file AbstractRecordCollection.php.

Referenced by TYPO3\CMS\Core\Category\Collection\CategoryCollection\__construct(), and TYPO3\CMS\Core\Collection\StaticRecordCollection\__construct().

◆ setTitle()

TYPO3\CMS\Core\Collection\AbstractRecordCollection::setTitle (   $title)

Setter for the title

Parameters
string$title
Returns
void

Implements TYPO3\CMS\Core\Collection\NameableCollectionInterface.

Definition at line 226 of file AbstractRecordCollection.php.

References TYPO3\CMS\Core\Collection\AbstractRecordCollection\$title.

◆ toArray()

◆ unserialize()

TYPO3\CMS\Core\Collection\AbstractRecordCollection::unserialize (   $serialized)

◆ usort()

TYPO3\CMS\Core\Collection\AbstractRecordCollection::usort (   $callbackFunction)

Sorts collection via given callBackFunction

The comparison function given as must return an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.

Parameters
$callbackFunction
See also
http://www.php.net/manual/en/function.usort.php
Returns
void

Implements TYPO3\CMS\Core\Collection\SortableCollectionInterface.

Definition at line 273 of file AbstractRecordCollection.php.

◆ valid()

TYPO3\CMS\Core\Collection\AbstractRecordCollection::valid ( )

(PHP 5 >= 5.1.0) Checks if current position is valid

bool The return value will be casted to boolean and then evaluated.

Definition at line 132 of file AbstractRecordCollection.php.

Member Data Documentation

◆ $description

TYPO3\CMS\Core\Collection\AbstractRecordCollection::$description
protected

◆ $itemTableName

TYPO3\CMS\Core\Collection\AbstractRecordCollection::$itemTableName
protected

◆ $storage

TYPO3\CMS\Core\Collection\AbstractRecordCollection::$storage
protected

◆ $storageItemsField

TYPO3\CMS\Core\Collection\AbstractRecordCollection::$storageItemsField = 'items'
staticprotected

Definition at line 43 of file AbstractRecordCollection.php.

◆ $storageTableName

TYPO3\CMS\Core\Collection\AbstractRecordCollection::$storageTableName = 'sys_collection'
staticprotected

Definition at line 36 of file AbstractRecordCollection.php.

◆ $title

◆ $uid