ContentItem
class ContentItem implements ContentItemInterface
Content item
Properties
protected array | $data | Content data | |
protected ContentTypeInterface | $type | Content item type | |
protected string | $id | Content item id |
Methods
boolean
__isset(string $name)
True if field exist
mixed
__get(string $name)
Get field value
getType()
Get content type
void
runAction(string $name, array|null $options = [])
Run action
static mixed
array
actions()
Get actions
array
fields()
Get fields
mixed
getValue(string $fieldName, mixed $default = null)
Get field value
FieldInterface|null
field(string $fieldName)
Get content field
void
setValue(string $fieldName, mixed $value)
Set field value
int|string
getId()
Get content item id
array
toArray()
To array
Details
at line 50
__construct(array $data, ContentTypeInterface $type, string $id)
Constructor
at line 63
boolean
__isset(string $name)
True if field exist
at line 74
mixed
__get(string $name)
Get field value
at line 84
ContentTypeInterface
getType()
Get content type
at line 96
void
runAction(string $name, array|null $options = [])
Run action
at line 114
static mixed
create(array $data, ContentTypeInterface $type, string $id)
Create content item
at line 124
array
actions()
Get actions
at line 134
array
fields()
Get fields
at line 154
mixed
getValue(string $fieldName, mixed $default = null)
Get field value
at line 170
FieldInterface|null
field(string $fieldName)
Get content field
at line 189
void
setValue(string $fieldName, mixed $value)
Set field value
at line 199
int|string
getId()
Get content item id
at line 209
array
toArray()
To array