EntityService
in package
One entity service
Table of Contents
Properties
- $columns : array<string|int, mixed>
- $entityClass : PermanentEntity>
- $fields : array<string|int, mixed>
Methods
- __construct() : mixed
- EntityService constructor.
- addColumn() : void
- createItem() : string
- deleteItem() : bool
- extractPublicArray() : array<string|int, mixed>
- getColumns() : array<string|int, mixed>
- getDomain() : string
- getEditableFields() : array<string|int, mixed>
- getEntityClass() : PermanentEntity>
- getFields() : array<string|int, mixed>
- getOwner() : AbstractUser|null
- getSelectQuery() : SqlSelectRequest
- loadItem() : PermanentEntity
- setFields() : void
- updateItem() : bool
Properties
$columns
protected
array<string|int, mixed>
$columns
= []
The columns
$entityClass
protected
PermanentEntity>
$entityClass
The entity class, if not used, override the calling methods
$fields
protected
array<string|int, mixed>
$fields
= []
The fields
Methods
__construct()
EntityService constructor.
public
__construct(string $entityClass) : mixed
Parameters
- $entityClass : string
addColumn()
public
addColumn(string $label, string $orderKey, callable $valueFunction) : void
Parameters
- $label : string
- $orderKey : string
- $valueFunction : callable
createItem()
public
createItem(array<string|int, mixed> $input[, array<string|int, mixed>|null $fields = null ]) : string
Parameters
- $input : array<string|int, mixed>
- $fields : array<string|int, mixed>|null = null
Return values
string —The new item ID
deleteItem()
public
deleteItem(PermanentEntity $item) : bool
Parameters
- $item : PermanentEntity
Return values
boolextractPublicArray()
public
extractPublicArray(object $item[, string $model = 'all' ]) : array<string|int, mixed>
Parameters
- $item : object
- $model : string = 'all'
Return values
array<string|int, mixed>getColumns()
public
getColumns() : array<string|int, mixed>
Return values
array<string|int, mixed>getDomain()
public
getDomain() : string
Return values
stringgetEditableFields()
public
getEditableFields(array<string|int, mixed> $input, PermanentEntity|null $item) : array<string|int, mixed>
Parameters
- $input : array<string|int, mixed>
- $item : PermanentEntity|null
Return values
array<string|int, mixed>getEntityClass()
public
getEntityClass() : PermanentEntity>
Return values
PermanentEntity>getFields()
public
getFields() : array<string|int, mixed>
Return values
array<string|int, mixed>getOwner()
public
getOwner(PermanentEntity $entity) : AbstractUser|null
Parameters
- $entity : PermanentEntity
Return values
AbstractUser|nullgetSelectQuery()
public
getSelectQuery([array<string|int, mixed>|null $filter = null ]) : SqlSelectRequest
Parameters
- $filter : array<string|int, mixed>|null = null
Return values
SqlSelectRequestloadItem()
public
loadItem(string $id) : PermanentEntity
Parameters
- $id : string
Tags
Return values
PermanentEntitysetFields()
public
setFields(array<string|int, mixed> $fields) : void
Parameters
- $fields : array<string|int, mixed>
updateItem()
public
updateItem(PermanentEntity $item, array<string|int, mixed> $input[, array<string|int, mixed>|null $fields = null ]) : bool
Parameters
- $item : PermanentEntity
- $input : array<string|int, mixed>
- $fields : array<string|int, mixed>|null = null