TYPO3  7.6
Public Member Functions | Protected Member Functions | List of all members
StaticRecordCollection Class Reference
Inheritance diagram for StaticRecordCollection:
AbstractRecordCollection EditableCollectionInterface RecordCollectionInterface PersistableCollectionInterface SortableCollectionInterface CollectionInterface NameableCollectionInterface

Public Member Functions

 __construct ($tableName=null)
 
 loadContents ()
 
 add ($data)
 
 addAll (CollectionInterface $other)
 
 remove ($data)
 
 removeAll ()
 
- Public Member Functions inherited from 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 PersistableCollectionInterface
 persist ()
 

Protected Member Functions

 getPersistableDataArray ()
 
 getCollectedRecords ()
 
 getDatabaseConnection ()
 
- Protected Member Functions inherited from AbstractRecordCollection
 getPersistableDataArray ()
 
 getItemUidList ($includeTableName=true)
 

Additional Inherited Members

- Static Public Member Functions inherited from AbstractRecordCollection
static load ($id, $fillItems=false)
 
static create (array $collectionRecord, $fillItems=false)
 
- Protected Attributes inherited from AbstractRecordCollection
 $uid = 0
 
 $title
 
 $description
 
 $itemTableName
 
 $storage
 
- Static Protected Attributes inherited from AbstractRecordCollection
static $storageTableName = 'sys_collection'
 
static $storageItemsField = 'items'
 

Detailed Description

Implementation of a RecordCollection for static TCA-Records

Definition at line 20 of file StaticRecordCollection.php.

Constructor & Destructor Documentation

__construct (   $tableName = null)

Creates this object.

Parameters
string$tableNameName of the table to be working on
Exceptions
\RuntimeException

Definition at line 50 of file StaticRecordCollection.php.

References elseif, and AbstractRecordCollection\setItemTableName().

Member Function Documentation

add (   $data)

Adds on entry to the collection

Parameters
mixed$data
Returns
void

Implements EditableCollectionInterface.

Definition at line 106 of file StaticRecordCollection.php.

Referenced by StaticRecordCollection\addAll(), and StaticRecordCollection\loadContents().

addAll ( CollectionInterface  $other)

Adds a set of entries to the collection

Parameters
CollectionInterface$other
Returns
void

Implements EditableCollectionInterface.

Definition at line 117 of file StaticRecordCollection.php.

References StaticRecordCollection\add().

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

Returns
array

Definition at line 163 of file StaticRecordCollection.php.

References StaticRecordCollection\getDatabaseConnection(), AbstractRecordCollection\getIdentifier(), and AbstractRecordCollection\getItemTableName().

Referenced by StaticRecordCollection\loadContents().

getDatabaseConnection ( )
protected

Gets the database object.

Returns

Definition at line 187 of file StaticRecordCollection.php.

References $GLOBALS.

Referenced by StaticRecordCollection\getCollectedRecords().

getPersistableDataArray ( )
protected

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

for internal usage in persist only.

Returns
array

Definition at line 89 of file StaticRecordCollection.php.

References AbstractRecordCollection\getDescription(), AbstractRecordCollection\getItemTableName(), AbstractRecordCollection\getItemUidList(), and AbstractRecordCollection\getTitle().

loadContents ( )

Populates the content-entries of the storage

Queries the underlying storage for entries of the collection and adds them to the collection data.

If the content entries of the storage had not been loaded on creation ($fillItems = false) this function is to be used for loading the contents afterwards.

Returns
void

Implements PersistableCollectionInterface.

Definition at line 72 of file StaticRecordCollection.php.

References StaticRecordCollection\add(), StaticRecordCollection\getCollectedRecords(), and StaticRecordCollection\removeAll().

remove (   $data)

Removes the given entry from collection

Note: not the given "index"

Parameters
mixed$data
Returns
void

Implements EditableCollectionInterface.

Definition at line 132 of file StaticRecordCollection.php.

removeAll ( )

Removes all entries from the collection

collection will be empty afterwards

Returns
void

Implements EditableCollectionInterface.

Definition at line 151 of file StaticRecordCollection.php.

Referenced by StaticRecordCollection\loadContents().