PageDoktypeRegistry

class \TYPO3\CMS\Core\DataHandling\PageDoktypeRegistry

Implements
SingletonInterface

This object defines the various types of pages (field: doktype) the system can handle and what restrictions may apply to them when adding records.

Here you can define which tables are allowed on a certain pagetype (doktype).

NOTE: The 'default' entry array is the 'base' for all types, and for every type the entries simply overrides the entries in the 'default' type!

You can fully use this once TCA is properly loaded (e.g. in ext_tables.php).

Table of Contents

Interfaces

SingletonInterface
"empty" interface for singletons (marker interface pattern)

Properties

$pageTypes  : array

Methods

add()  : void
Adds a specific configuration for a doktype. By default, it is NOT restricted to only allow tables that have been explicitly added via addAllowedRecordTypes().
addAllowedRecordTypes()  : void
doesDoktypeOnlyAllowSpecifiedRecordTypes()  : bool
Used to find out if a specific doktype is restricted to only allow a certain list of tables.
exportConfiguration()  : array
getAllowedTypesForDoktype()  : array
getRegisteredDoktypes()  : array
isRecordTypeAllowedForDoktype()  : bool
Check if a record can be added on a page with a given $doktype.

Properties

$pageTypes

protected array $pageTypes = [ \TYPO3\CMS\Core\Domain\Repository\PageRepository::DOKT…
Show the full value[ \TYPO3\CMS\Core\Domain\Repository\PageRepository::DOKTYPE_BE_USER_SECTION => ['allowedTables' => '*'], // Doktype 254 is a 'Folder' - a general purpose storage folder for whatever you like. // In CMS context it's NOT a viewable page. Can contain any element. \TYPO3\CMS\Core\Domain\Repository\PageRepository::DOKTYPE_SYSFOLDER => ['allowedTables' => '*'], // Doktype 255 is a recycle-bin. \TYPO3\CMS\Core\Domain\Repository\PageRepository::DOKTYPE_RECYCLER => ['allowedTables' => '*'], \TYPO3\CMS\Core\Domain\Repository\PageRepository::DOKTYPE_MOUNTPOINT => [], // Even though both options look contradictory, the "allowedTables" key is used for other $pageTypes // that have no custom definitions. So "allowedTables" works as a fallback for additional page types // Effectively working like "allowTableOnStandardPages()" as the default entry is a "standard page" 'default' => ['allowedTables' => 'pages,sys_category,sys_file_reference,sys_file_collection', 'onlyAllowedTables' => false], ]

Methods

add()

Adds a specific configuration for a doktype. By default, it is NOT restricted to only allow tables that have been explicitly added via addAllowedRecordTypes().

public add(int $dokType, array $configuration) : void

Parameters

$dokType : int
$configuration : array

addAllowedRecordTypes()

public addAllowedRecordTypes(array $recordTypes[, int|null $doktype = null ]) : void

Parameters

$recordTypes : array
$doktype : int|null = null

doesDoktypeOnlyAllowSpecifiedRecordTypes()

Used to find out if a specific doktype is restricted to only allow a certain list of tables.

public doesDoktypeOnlyAllowSpecifiedRecordTypes([int|null $doktype = null ]) : bool

This list can be checked against via 'isRecordTypeAllowedForDoktype()'

Parameters

$doktype : int|null = null

Return values

bool

exportConfiguration()

public exportConfiguration() : array

Return values

array

getAllowedTypesForDoktype()

public getAllowedTypesForDoktype(int $doktype) : array

Parameters

$doktype : int

Return values

array

getRegisteredDoktypes()

public getRegisteredDoktypes() : array

Return values

array

isRecordTypeAllowedForDoktype()

Check if a record can be added on a page with a given $doktype.

public isRecordTypeAllowedForDoktype(string $type, int|null $doktype) : bool

Parameters

$type : string
$doktype : int|null

Return values

bool
On this page