TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
FileCollectionRegistry Class Reference
Inheritance diagram for FileCollectionRegistry:
SingletonInterface

Public Member Functions

 __construct ()
 
 registerFileCollectionClass ($className, $type, $override=false)
 
 addTypeToTCA ($type, $label, $availableFields, array $additionalColumns=[])
 
 getFileCollectionClass ($type)
 
 fileCollectionTypeExists ($type)
 

Protected Attributes

 $types = []
 

Detailed Description

Registry for FileCollection classes

Definition at line 22 of file FileCollectionRegistry.php.

Constructor & Destructor Documentation

__construct ( )

Constructor

Definition at line 34 of file FileCollectionRegistry.php.

References $GLOBALS, and FileCollectionRegistry\registerFileCollectionClass().

Member Function Documentation

addTypeToTCA (   $type,
  $label,
  $availableFields,
array  $additionalColumns = [] 
)

Add the type to the TCA of sys_file_collection

Parameters
string$type
string$label
string$availableFieldscomma separated list of fields to show
array$additionalColumnsAdditional columns configuration
Returns
array adjusted TCA for sys_file_collection

Definition at line 86 of file FileCollectionRegistry.php.

References $GLOBALS, and ArrayUtility\mergeRecursiveWithOverrule().

fileCollectionTypeExists (   $type)

Checks if the given FileCollection type exists

Parameters
string$typeType of the FileCollection
Returns
bool TRUE if the FileCollection exists, FALSE otherwise

Definition at line 133 of file FileCollectionRegistry.php.

getFileCollectionClass (   $type)

Returns a class name for a given type

Parameters
string$type
Returns
string The class name
Exceptions
InvalidArgumentException

Definition at line 119 of file FileCollectionRegistry.php.

registerFileCollectionClass (   $className,
  $type,
  $override = false 
)

Register a (new) FileCollection type

Parameters
string$className
string$typeFileCollection type max length 30 chars (db field restriction)
bool$overrideexisting FileCollection type
Returns
bool TRUE if registration succeeded
Exceptions
InvalidArgumentException

Definition at line 50 of file FileCollectionRegistry.php.

Referenced by FileCollectionRegistry\__construct().

Member Data Documentation

$types = []
protected

Definition at line 29 of file FileCollectionRegistry.php.