ContentItem
in package
implements
ContentItemInterface
Content item
Table of Contents
Interfaces
- ContentItemInterface
- Content item interface
Properties
- $data : array<string|int, mixed>
- Content data
- $id : string
- Content item id
- $type : ContentTypeInterface
- Content item type
Methods
- __construct() : mixed
- Constructor
- __get() : mixed
- Get field value
- __isset() : bool
- True if field exist
- actions() : array<string|int, mixed>
- Get actions
- create() : mixed
- Create content item
- field() : FieldInterface|null
- Get content field
- fields() : array<string|int, mixed>
- Get fields
- getDataArray() : array<string|int, mixed>
- Get data array
- getId() : string
- Get content item id
- getTitle() : string
- Get title fields value
- getType() : ContentTypeInterface
- Get content type
- getValue() : mixed
- Get field value
- isEmpty() : bool
- Return true if content item is empty
- runAction() : mixed
- Run action
- setValue() : void
- Set field value
- toArray() : array<string|int, mixed>
- To array
Properties
$data
Content data
protected
array<string|int, mixed>
$data
$id
Content item id
protected
string
$id
$type
Content item type
protected
ContentTypeInterface
$type
Methods
__construct()
Constructor
public
__construct(array<string|int, mixed> $data, ContentTypeInterface $type, string $id) : mixed
Parameters
- $data : array<string|int, mixed>
- $type : ContentTypeInterface
- $id : string
__get()
Get field value
public
__get(string $name) : mixed
Parameters
- $name : string
__isset()
True if field exist
public
__isset(string $name) : bool
Parameters
- $name : string
Return values
boolactions()
Get actions
public
actions() : array<string|int, mixed>
Return values
array<string|int, mixed>create()
Create content item
public
static create(array<string|int, mixed> $data, ContentTypeInterface $type, string $id) : mixed
Parameters
- $data : array<string|int, mixed>
- $type : ContentTypeInterface
- $id : string
field()
Get content field
public
field(string $fieldName) : FieldInterface|null
Parameters
- $fieldName : string
Return values
FieldInterface|nullfields()
Get fields
public
fields() : array<string|int, mixed>
Return values
array<string|int, mixed>getDataArray()
Get data array
public
getDataArray() : array<string|int, mixed>
Return values
array<string|int, mixed>getId()
Get content item id
public
getId() : string
Return values
stringgetTitle()
Get title fields value
public
getTitle() : string
Return values
stringgetType()
Get content type
public
getType() : ContentTypeInterface
Return values
ContentTypeInterfacegetValue()
Get field value
public
getValue(string $fieldName[, mixed $default = null ]) : mixed
Parameters
- $fieldName : string
- $default : mixed = null
isEmpty()
Return true if content item is empty
public
isEmpty() : bool
Return values
boolrunAction()
Run action
public
runAction(string $name[, array<string|int, mixed>|null $options = [] ]) : mixed
Parameters
- $name : string
- $options : array<string|int, mixed>|null = []
setValue()
Set field value
public
setValue(string $fieldName, mixed $value) : void
Parameters
- $fieldName : string
- $value : mixed
toArray()
To array
public
toArray() : array<string|int, mixed>