abstract class AbstractContentProvider implements ContentProviderInterface

Abstract content provider class

Traits

Content provider trait

Properties

protected string $contentProviderName Content provider name
protected string $contentProviderTitle Content provider title
protected string|null $contentProviderCategory Content provider category
protected string $contentType Content type name or handler class

Methods

array|null
createItem(array $data, string|null $contentType = null)

Create new content item

bool
saveItem(string|int $key, array $data, string|null $contentType = null)

Save content item

int|null
getItemsCount()

Get total data items

string
getClass()

Get class name

ContentTypeInterface|null
getContentType()

Get supported content type

array
getSupportedContentTypes()

Get supported content types

void
setContentType(ContentTypeInterface $contentType)

Set content type

string
getProviderName()

Get provider name

string|null
getProviderTitle()

Get provider title

string|null
getProviderCategory()

Get provider category

ContentItemInterface|null
get(mixed $key)

Get content

array|null
getContentItems(mixed|null $filter = null, int $page = 1, int $perPage = 20)

Get content list

__construct()

Constructor

array|null
getContent(string|int|array $key)

Get content

Details

in ContentProvider at line 28
array|null createItem(array $data, string|null $contentType = null)

Create new content item

Parameters

array $data
string|null $contentType Content type name

Return Value

array|null

in ContentProvider at line 41
bool saveItem(string|int $key, array $data, string|null $contentType = null)

Save content item

Parameters

string|int $key
array $data
string|null $contentType Content type name

Return Value

bool

in ContentProvider at line 51
int|null getItemsCount()

Get total data items

Return Value

int|null

in ContentProvider at line 61
string getClass()

Get class name

Return Value

string

in ContentProvider at line 71
ContentTypeInterface|null getContentType()

Get supported content type

Return Value

ContentTypeInterface|null

in ContentProvider at line 81
array getSupportedContentTypes()

Get supported content types

Return Value

array

in ContentProvider at line 92
void setContentType(ContentTypeInterface $contentType)

Set content type

Parameters

ContentTypeInterface $contentType

Return Value

void

in ContentProvider at line 103
string getProviderName()

Get provider name

Return Value

string

Exceptions

Exception

in ContentProvider at line 117
string|null getProviderTitle()

Get provider title

Return Value

string|null

in ContentProvider at line 127
string|null getProviderCategory()

Get provider category

Return Value

string|null

in ContentProvider at line 138
ContentItemInterface|null get(mixed $key)

Get content

Parameters

mixed $key Id, Uuid or content name slug

Return Value

ContentItemInterface|null

in ContentProvider at line 159
array|null getContentItems(mixed|null $filter = null, int $page = 1, int $perPage = 20)

Get content list

Parameters

mixed|null $filter
int $page
int $perPage

Return Value

array|null

at line 53
__construct()

Constructor

at line 63
abstract array|null getContent(string|int|array $key)

Get content

Parameters

string|int|array $key Id, Uuid or content name slug

Return Value

array|null