TYPO3 CMS  TYPO3_6-2
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 t3lib_collection_AbstractRecordCollection TYPO3\CMS\Core\Category\Collection\CategoryCollection TYPO3\CMS\Core\Collection\StaticRecordCollection TYPO3\CMS\Core\Resource\Collection\AbstractFileCollection TYPO3\CMS\Frontend\Category\Collection\CategoryCollection t3lib_collection_StaticRecordCollection 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

This file is part of the TYPO3 CMS project.

It is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, either version 2 of the License, or any later version.

For the full copyright and license information, please read the LICENSE.txt file that was distributed with this source code.

The TYPO3 project - inspiring people to share! 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

Author
Steffen Ritter typo3.nosp@m.@ste.nosp@m.ffen-.nosp@m.ritt.nosp@m.er.ne.nosp@m.t

Definition at line 30 of file AbstractRecordCollection.php.

Constructor & Destructor Documentation

◆ __construct()

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

Creates this object.

Definition at line 84 of file AbstractRecordCollection.php.

Member Function Documentation

◆ count()

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

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

integer The custom count as an integer.

Definition at line 178 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 405 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
boolean$includeTableName
Returns
string

Definition at line 372 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
integer

Definition at line 196 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

integer 0 on failure.

Definition at line 117 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
integer$idId of database record to be loaded
boolean$fillItemsPopulates the entries directly on load, might be bad for memory on large collections
Returns

Implements TYPO3\CMS\Core\Collection\PersistableCollectionInterface.

Definition at line 308 of file AbstractRecordCollection.php.

References $GLOBALS.

◆ 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
integer$currentPosition
integer$newPosition
Returns
void

Implements TYPO3\CMS\Core\Collection\SortableCollectionInterface.

Definition at line 273 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 106 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 140 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 225 of file AbstractRecordCollection.php.

◆ setIdentifier()

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

Sets the identifier of the collection

Parameters
integer$id
Returns
void

Implements TYPO3\CMS\Core\Collection\PersistableCollectionInterface.

Definition at line 293 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 244 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 215 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 258 of file AbstractRecordCollection.php.

◆ valid()

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

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

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

Definition at line 129 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 44 of file AbstractRecordCollection.php.

◆ $storageTableName

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

Definition at line 37 of file AbstractRecordCollection.php.

◆ $title

◆ $uid