class ContentManager implements ContentManagerInterface

Content providers registry manager

Traits

Php Config file loader and writer

Constants

PROVIDERS_FILE_NAME

Default providers config file name

Properties

protected array $comments Config array comments from PhpConfigFile
protected array|null $contentProviders Content providers
protected null $contentTypeRegistry Content type registry

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 $providersFileName = null)

Constructor

bool
hasContentType(string $name)

Return true if content typ eexists

ContentProviderInterface|null
type(string $name, string|null $providerName = null)

Get content type from registry

object
typeRegistry()

Get content type registry

mixed
createItem(mixed $data, string $contentType)

Create content item

void
load(bool $reload = false)

Load content providers and content types

array
getProviders(string|null $category = null, string|null $contentType = null)

Get content providers list

ContentProviderInterface|null
provider(string $name)

Get content provider

bool
hasProvider(string $name)

Check if provider exists

bool
registerProvider(object|string $provider)

Register content provider

bool
unRegisterProvider(string $name)

Unregister content provider

array
resolveProviderDetails(ContentProviderInterface $provider)

Resolve provider edetails

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 59
__construct(string|null $providersFileName = null)

Constructor

Parameters

string|null $providersFileName

at line 70
bool hasContentType(string $name)

Return true if content typ eexists

Parameters

string $name

Return Value

bool

at line 81
ContentProviderInterface|null type(string $name, string|null $providerName = null)

Get content type from registry

Parameters

string $name
string|null $providerName

Return Value

ContentProviderInterface|null

at line 107
object typeRegistry()

Get content type registry

Return Value

object

at line 123
mixed createItem(mixed $data, string $contentType)

Create content item

Parameters

mixed $data
string $contentType

Return Value

mixed

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

Load content providers and content types

Parameters

bool $reload

Return Value

void

at line 161
array getProviders(string|null $category = null, string|null $contentType = null)

Get content providers list

Parameters

string|null $category
string|null $contentType

Return Value

array

at line 184
ContentProviderInterface|null provider(string $name)

Get content provider

Parameters

string $name

Return Value

ContentProviderInterface|null

at line 204
bool hasProvider(string $name)

Check if provider exists

Parameters

string $name

Return Value

bool

at line 215
bool registerProvider(object|string $provider)

Register content provider

Parameters

object|string $provider

Return Value

bool

at line 244
bool unRegisterProvider(string $name)

Unregister content provider

Parameters

string $name

Return Value

bool

at line 264
protected array resolveProviderDetails(ContentProviderInterface $provider)

Resolve provider edetails

Parameters

ContentProviderInterface $provider

Return Value

array

Exceptions

Exception