TYPO3  7.6
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
AbstractRecordCollection Class Reference
Inheritance diagram for AbstractRecordCollection:
RecordCollectionInterface PersistableCollectionInterface SortableCollectionInterface CollectionInterface NameableCollectionInterface CategoryCollection StaticRecordCollection AbstractFileCollection CategoryCollection CategoryBasedFileCollection FolderBasedFileCollection 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 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 ( )

Creates this object.

Definition at line 83 of file AbstractRecordCollection.php.

Member Function Documentation

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.

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

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

Parameters
array$collectionRecordDatabase record
bool$fillItemsPopulates the entries directly on load, might be bad for memory on large collections
Returns

Definition at line 345 of file AbstractRecordCollection.php.

Referenced by RecordCollectionRepository\createDomainObject().

current ( )

(PHP 5 >= 5.1.0) Return the current element

mixed Can return any type.

Definition at line 95 of file AbstractRecordCollection.php.

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 (   $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 $list, and AbstractRecordCollection\getItemTableName().

Referenced by StaticRecordCollection\getPersistableDataArray(), and CategoryCollection\getPersistableDataArray().

getPersistableDataArray ( )
abstractprotected

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

For internal usage in persist only.

Returns
array
getTitle ( )
getUid ( )

Getter for the UID

Returns
int

Definition at line 205 of file AbstractRecordCollection.php.

References AbstractRecordCollection\$uid.

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.

static 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 PersistableCollectionInterface.

Definition at line 327 of file AbstractRecordCollection.php.

References $GLOBALS, and BackendUtility\deleteClause().

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 SortableCollectionInterface.

Definition at line 289 of file AbstractRecordCollection.php.

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

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

(PHP 5 >= 5.1.0) String representation of object

string the string representation of the object or

Definition at line 156 of file AbstractRecordCollection.php.

References AbstractRecordCollection\getIdentifier().

setDescription (   $desc)

Setter for the description

Parameters
string$desc
Returns
void

Implements NameableCollectionInterface.

Definition at line 237 of file AbstractRecordCollection.php.

setIdentifier (   $id)

Sets the identifier of the collection

Parameters
int$id
Returns
void

Implements PersistableCollectionInterface.

Definition at line 311 of file AbstractRecordCollection.php.

setItemTableName (   $tableName)

Setter for the name of the data-source table

Parameters
string$tableName
Returns
void

Implements RecordCollectionInterface.

Definition at line 258 of file AbstractRecordCollection.php.

Referenced by CategoryCollection\__construct(), and StaticRecordCollection\__construct().

setTitle (   $title)

Setter for the title

Parameters
string$title
Returns
void

Implements NameableCollectionInterface.

Definition at line 226 of file AbstractRecordCollection.php.

References AbstractRecordCollection\$title.

toArray ( )
unserialize (   $serialized)
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 SortableCollectionInterface.

Definition at line 273 of file AbstractRecordCollection.php.

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
protected
$itemTableName
protected
$storage
protected

Definition at line 78 of file AbstractRecordCollection.php.

$storageItemsField = 'items'
staticprotected

Definition at line 43 of file AbstractRecordCollection.php.

$storageTableName = 'sys_collection'
staticprotected

Definition at line 36 of file AbstractRecordCollection.php.

$title
protected
$uid = 0
protected