class ContentTypeRegistry

Content type registry manager

Traits

Php Config file loader and writer

Constants

CONTENT_TYPES_FILE_NAME

Default content types registry config file name

Properties

protected array $comments Config array comments from PhpConfigFile
protected array|null $contentTypes Content types

Methods

array|null
include(string $fileName)

Include config file

array|null
includePhpArray(string $fileName)

Include php array

void
setComment(string $comment, string $key)

Set array key comment

string
getCommentsText(string $key)

Get array imtem comment as text

string
exportArray(array $data, string $arrayKey, int $currentTab = 1, int $endTab = 1)

Export array as text

string
exportItem(string $key, mixed $value, int $maxTabs)

Export item as text

string
exportConfig(array $data)

Export config as text

bool
saveConfigFile(string $fileName, array $data)

Save config file

__construct(string|null $contentTypesFileName = null)

Constructor

void
load(bool $reload = false)

Load content providers and content types

array
getContentTypes(string|null $category = null)

Get registered content types list

ContentTypeInterface|null
get(string $name)

Get content type

bool
has(string $name)

Check if content type exists

array|null
getPoviders(string $contentType)

Get all content prioviders for type

bool
addProvider(string $contentType, string $name)

Add content type provider

bool
registerAction(string $contentType, string $class)

Register content type action

bool
register($contentType)

Register content provider

bool
unRegister(string $name)

Unregister content provider

array
resolveDetails(ContentTypeInterface $contentType)

Resolve content type details

Details

in PhpConfigFile at line 33
array|null include(string $fileName)

Include config file

Parameters

string $fileName

Return Value

array|null

in PhpConfigFile at line 44
array|null includePhpArray(string $fileName)

Include php array

Parameters

string $fileName

Return Value

array|null

in PhpConfigFile at line 62
protected void setComment(string $comment, string $key)

Set array key comment

Parameters

string $comment
string $key

Return Value

void

in PhpConfigFile at line 73
protected string getCommentsText(string $key)

Get array imtem comment as text

Parameters

string $key

Return Value

string

in PhpConfigFile at line 100
protected string exportArray(array $data, string $arrayKey, int $currentTab = 1, int $endTab = 1)

Export array as text

Parameters

array $data
string $arrayKey
int $currentTab
int $endTab

Return Value

string

in PhpConfigFile at line 144
protected string exportItem(string $key, mixed $value, int $maxTabs)

Export item as text

Parameters

string $key
mixed $value
int $maxTabs

Return Value

string

in PhpConfigFile at line 158
protected string exportConfig(array $data)

Export config as text

Parameters

array $data

Return Value

string

in PhpConfigFile at line 245
bool saveConfigFile(string $fileName, array $data)

Save config file

Parameters

string $fileName
array $data

Return Value

bool

at line 49
__construct(string|null $contentTypesFileName = null)

Constructor

Parameters

string|null $contentTypesFileName

at line 60
void load(bool $reload = false)

Load content providers and content types

Parameters

bool $reload

Return Value

void

at line 73
array getContentTypes(string|null $category = null)

Get registered content types list

Parameters

string|null $category

Return Value

array

at line 96
ContentTypeInterface|null get(string $name)

Get content type

Parameters

string $name

Return Value

ContentTypeInterface|null

at line 116
bool has(string $name)

Check if content type exists

Parameters

string $name

Return Value

bool

at line 127
array|null getPoviders(string $contentType)

Get all content prioviders for type

Parameters

string $contentType

Return Value

array|null

at line 145
bool addProvider(string $contentType, string $name)

Add content type provider

Parameters

string $contentType
string $name

Return Value

bool

at line 169
bool registerAction(string $contentType, string $class)

Register content type action

Parameters

string $contentType
string $class

Return Value

bool

Exceptions

Exception

at line 205
bool register($contentType)

Register content provider

Parameters

$contentType

Return Value

bool

Exceptions

Exception

at line 236
bool unRegister(string $name)

Unregister content provider

Parameters

string $name

Return Value

bool

at line 256
protected array resolveDetails(ContentTypeInterface $contentType)

Resolve content type details

Parameters

ContentTypeInterface $contentType

Return Value

array

Exceptions

Exception