‪TYPO3CMS  10.4
TYPO3\CMS\Core\Collection\RecordCollectionRepository Class Reference
Inheritance diagram for TYPO3\CMS\Core\Collection\RecordCollectionRepository:
TYPO3\CMS\Core\Resource\FileCollectionRepository

Public Member Functions

TYPO3 CMS Core Collection AbstractRecordCollection null findByUid ($uid)
 
TYPO3 CMS Core Collection AbstractRecordCollection[] null findAll ()
 
TYPO3 CMS Core Collection AbstractRecordCollection[] findByTableName ($tableName)
 
TYPO3 CMS Core Collection AbstractRecordCollection[] null findByType ($type)
 
TYPO3 CMS Core Collection AbstractRecordCollection[] null findByTypeAndTableName ($type, $tableName)
 
 deleteByUid ($uid)
 

Public Attributes

const TYPE_Static = 'static'
 

Protected Member Functions

TYPO3 CMS Core Collection AbstractRecordCollection[] null queryMultipleRecords (array $conditions=[])
 
TYPO3 CMS Core Collection AbstractRecordCollection createDomainObject (array $record)
 
TYPO3 CMS Core Collection AbstractRecordCollection[] createMultipleDomainObjects (array $data)
 
string getEnvironmentMode ()
 

Protected Attributes

string $table = 'sys_collection'
 
string $typeField = 'type'
 
string $tableField = 'table_name'
 

Detailed Description

Implements the repository for record collections.

Definition at line 27 of file RecordCollectionRepository.php.

Member Function Documentation

◆ createDomainObject()

TYPO3 CMS Core Collection AbstractRecordCollection TYPO3\CMS\Core\Collection\RecordCollectionRepository::createDomainObject ( array  $record)
protected

Creates a record collection domain object.

Parameters
array$recordDatabase record to be reconstituted
Returns
‪\TYPO3\CMS\Core\Collection\AbstractRecordCollection
Exceptions

Reimplemented in TYPO3\CMS\Core\Resource\FileCollectionRepository.

Definition at line 194 of file RecordCollectionRepository.php.

References TYPO3\CMS\Core\Collection\StaticRecordCollection\create(), and TYPO3\CMS\Core\Collection\RecordCollectionRepository\TYPE_Static.

Referenced by TYPO3\CMS\Core\Collection\RecordCollectionRepository\createMultipleDomainObjects(), and TYPO3\CMS\Core\Collection\RecordCollectionRepository\findByUid().

◆ createMultipleDomainObjects()

TYPO3 CMS Core Collection AbstractRecordCollection [] TYPO3\CMS\Core\Collection\RecordCollectionRepository::createMultipleDomainObjects ( array  $data)
protected

Creates multiple record collection domain objects.

Parameters
array$data‪Array of multiple database records to be reconstituted
Returns
‪\TYPO3\CMS\Core\Collection\AbstractRecordCollection[]

Definition at line 212 of file RecordCollectionRepository.php.

References TYPO3\CMS\Core\Collection\RecordCollectionRepository\createDomainObject().

Referenced by TYPO3\CMS\Core\Collection\RecordCollectionRepository\queryMultipleRecords().

◆ deleteByUid()

TYPO3\CMS\Core\Collection\RecordCollectionRepository::deleteByUid (   $uid)

Deletes a record collection by uid.

Parameters
int$uid‪uid to be deleted

Definition at line 146 of file RecordCollectionRepository.php.

References $GLOBALS.

◆ findAll()

TYPO3 CMS Core Collection AbstractRecordCollection [] null TYPO3\CMS\Core\Collection\RecordCollectionRepository::findAll ( )

Finds all record collections.

Returns
‪\TYPO3\CMS\Core\Collection\AbstractRecordCollection[]|null

Definition at line 83 of file RecordCollectionRepository.php.

References TYPO3\CMS\Core\Collection\RecordCollectionRepository\queryMultipleRecords().

◆ findByTableName()

TYPO3 CMS Core Collection AbstractRecordCollection [] TYPO3\CMS\Core\Collection\RecordCollectionRepository::findByTableName (   $tableName)

Finds record collections by table name.

Parameters
string$tableName‪Name of the table to be looked up
Returns
‪\TYPO3\CMS\Core\Collection\AbstractRecordCollection[]

Definition at line 94 of file RecordCollectionRepository.php.

References TYPO3\CMS\Core\Collection\RecordCollectionRepository\queryMultipleRecords().

◆ findByType()

TYPO3 CMS Core Collection AbstractRecordCollection [] null TYPO3\CMS\Core\Collection\RecordCollectionRepository::findByType (   $type)

Finds record collection by type.

Parameters
string$typeType to be looked up
Returns
‪\TYPO3\CMS\Core\Collection\AbstractRecordCollection[]|null

Definition at line 111 of file RecordCollectionRepository.php.

References TYPO3\CMS\Core\Collection\RecordCollectionRepository\queryMultipleRecords().

◆ findByTypeAndTableName()

TYPO3 CMS Core Collection AbstractRecordCollection [] null TYPO3\CMS\Core\Collection\RecordCollectionRepository::findByTypeAndTableName (   $type,
  $tableName 
)

Finds record collections by type and table name.

Parameters
string$typeType to be looked up
string$tableName‪Name of the table to be looked up
Returns
‪\TYPO3\CMS\Core\Collection\AbstractRecordCollection[]|null

Definition at line 129 of file RecordCollectionRepository.php.

References TYPO3\CMS\Core\Collection\RecordCollectionRepository\queryMultipleRecords().

◆ findByUid()

TYPO3 CMS Core Collection AbstractRecordCollection null TYPO3\CMS\Core\Collection\RecordCollectionRepository::findByUid (   $uid)

Finds a record collection by uid.

Parameters
int$uid‪The uid to be looked up
Returns
‪\TYPO3\CMS\Core\Collection\AbstractRecordCollection|null

Reimplemented in TYPO3\CMS\Core\Resource\FileCollectionRepository.

Definition at line 54 of file RecordCollectionRepository.php.

References TYPO3\CMS\Core\Collection\RecordCollectionRepository\createDomainObject(), and TYPO3\CMS\Core\Collection\RecordCollectionRepository\getEnvironmentMode().

◆ getEnvironmentMode()

string TYPO3\CMS\Core\Collection\RecordCollectionRepository::getEnvironmentMode ( )
protected

Function to return the current TYPO3_MODE (FE/BE) based on $GLOBALS[TSFE]. This function can be mocked in unit tests to be able to test frontend behaviour.

Returns
‪string

Definition at line 227 of file RecordCollectionRepository.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Core\Collection\RecordCollectionRepository\findByUid().

◆ queryMultipleRecords()

TYPO3 CMS Core Collection AbstractRecordCollection [] null TYPO3\CMS\Core\Collection\RecordCollectionRepository::queryMultipleRecords ( array  $conditions = [])
protected

Queries for multiple records for the given conditions.

Parameters
array$conditions‪Conditions concatenated with AND for query
Returns
‪\TYPO3\CMS\Core\Collection\AbstractRecordCollection[]|null

Definition at line 163 of file RecordCollectionRepository.php.

References TYPO3\CMS\Core\Collection\RecordCollectionRepository\createMultipleDomainObjects().

Referenced by TYPO3\CMS\Core\Collection\RecordCollectionRepository\findAll(), TYPO3\CMS\Core\Collection\RecordCollectionRepository\findByTableName(), TYPO3\CMS\Core\Collection\RecordCollectionRepository\findByType(), and TYPO3\CMS\Core\Collection\RecordCollectionRepository\findByTypeAndTableName().

Member Data Documentation

◆ $table

string TYPO3\CMS\Core\Collection\RecordCollectionRepository::$table = 'sys_collection'
protected

Name of the table the collection records are stored to

Definition at line 38 of file RecordCollectionRepository.php.

◆ $tableField

string TYPO3\CMS\Core\Collection\RecordCollectionRepository::$tableField = 'table_name'
protected

Definition at line 46 of file RecordCollectionRepository.php.

◆ $typeField

string TYPO3\CMS\Core\Collection\RecordCollectionRepository::$typeField = 'type'
protected

Definition at line 42 of file RecordCollectionRepository.php.

◆ TYPE_Static