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

Public Member Functions

 __construct ($tableName=null, $fieldName=null)
 
 loadContents ()
 
 add ($data)
 
 addAll (CollectionInterface $other)
 
 remove ($data)
 
 removeAll ()
 
 setRelationFieldName ($field)
 
 getRelationFieldName ()
 
- 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 ()
 

Static Public Member Functions

static load ($id, $fillItems=false, $tableName= '', $fieldName= '')
 
static getStorageTableName ()
 
static getStorageItemsField ()
 
- Static Public Member Functions inherited from AbstractRecordCollection
static load ($id, $fillItems=false)
 
static create (array $collectionRecord, $fillItems=false)
 

Protected Member Functions

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

Static Protected Member Functions

static getDatabaseConnection ()
 

Protected Attributes

 $relationFieldName = 'categories'
 
- Protected Attributes inherited from AbstractRecordCollection
 $uid = 0
 
 $title
 
 $description
 
 $itemTableName
 
 $storage
 

Static Protected Attributes

static $storageTableName = 'sys_category'
 
- Static Protected Attributes inherited from AbstractRecordCollection
static $storageTableName = 'sys_collection'
 
static $storageItemsField = 'items'
 

Detailed Description

Category Collection to handle records attached to a category

Definition at line 26 of file core/Classes/Category/Collection/CategoryCollection.php.

Constructor & Destructor Documentation

__construct (   $tableName = null,
  $fieldName = null 
)

Creates this object.

Parameters
string$tableNameName of the table to be working on
string$fieldNameName of the field where the categories relations are defined
Exceptions
\RuntimeException

Definition at line 49 of file core/Classes/Category/Collection/CategoryCollection.php.

References elseif, AbstractRecordCollection\setItemTableName(), and CategoryCollection\setRelationFieldName().

Member Function Documentation

add (   $data)

Adds on entry to the collection

Parameters
mixed$data
Returns
void

Implements EditableCollectionInterface.

Definition at line 190 of file core/Classes/Category/Collection/CategoryCollection.php.

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

addAll ( CollectionInterface  $other)

Adds a set of entries to the collection

Parameters
CollectionInterface$other
Returns
void

Implements EditableCollectionInterface.

Definition at line 201 of file core/Classes/Category/Collection/CategoryCollection.php.

References CategoryCollection\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 116 of file core/Classes/Category/Collection/CategoryCollection.php.

References AbstractRecordCollection\getIdentifier(), AbstractRecordCollection\getItemTableName(), and CategoryCollection\getRelationFieldName().

Referenced by CategoryCollection\loadContents().

static getDatabaseConnection ( )
staticprotected

Gets the database object.

Returns

Definition at line 298 of file core/Classes/Category/Collection/CategoryCollection.php.

References $GLOBALS.

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 175 of file core/Classes/Category/Collection/CategoryCollection.php.

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

getRelationFieldName ( )

Gets the name of the categories relation field

Returns
string

Definition at line 268 of file core/Classes/Category/Collection/CategoryCollection.php.

References CategoryCollection\$relationFieldName.

Referenced by CategoryCollection\getCollectedRecords().

static getStorageItemsField ( )
static

Getter for the storage items field

Returns
string

Definition at line 288 of file core/Classes/Category/Collection/CategoryCollection.php.

static getStorageTableName ( )
static

Getter for the storage table name

Returns
string

Definition at line 278 of file core/Classes/Category/Collection/CategoryCollection.php.

static load (   $id,
  $fillItems = false,
  $tableName = '',
  $fieldName = '' 
)
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
string$tableNameName of table from which entries should be loaded
string$fieldNameName of the categories relation field
Returns
CollectionInterface

Definition at line 97 of file core/Classes/Category/Collection/CategoryCollection.php.

References BackendUtility\deleteClause().

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 159 of file core/Classes/Category/Collection/CategoryCollection.php.

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

remove (   $data)

Removes the given entry from collection Note: not the given "index"

Parameters
mixed$data
Returns
void

Implements EditableCollectionInterface.

Definition at line 215 of file core/Classes/Category/Collection/CategoryCollection.php.

removeAll ( )

Removes all entries from the collection collection will be empty afterwards

Returns
void

Implements EditableCollectionInterface.

Definition at line 233 of file core/Classes/Category/Collection/CategoryCollection.php.

Referenced by CategoryCollection\loadContents().

setRelationFieldName (   $field)

Sets the name of the categories relation field

Parameters
string$field

Definition at line 258 of file core/Classes/Category/Collection/CategoryCollection.php.

Referenced by CategoryCollection\__construct().

Member Data Documentation

$relationFieldName = 'categories'
protected
$storageTableName = 'sys_category'
staticprotected