ModelInterface
in
Interface ModelInterface.
Tags
Table of Contents
- create() : false|int|string
- Create a new item.
- delete() : false|int|string
- Delete based on id.
- read() : Entity|array<string, float|int|string|null>|stdClass|null
- Read an item based on id.
- update() : false|int|string
- Update based on id and return the number of updated items.
Methods
create()
Create a new item.
public
create(Entity|array<string, float|int|string|null>|stdClass $data) : false|int|string
Parameters
- $data : Entity|array<string, float|int|string|null>|stdClass
Return values
false|int|string —The created item id on success or false if it could not be created
delete()
Delete based on id.
public
delete(int|string $id) : false|int|string
Parameters
- $id : int|string
Return values
false|int|string —The number of deleted items or false if it could not be deleted
read()
Read an item based on id.
public
read(int|string $id) : Entity|array<string, float|int|string|null>|stdClass|null
Parameters
- $id : int|string
Tags
Return values
Entity|array<string, float|int|string|null>|stdClass|null —The item as array, Entity or stdClass or null if the item was not found
update()
Update based on id and return the number of updated items.
public
update(int|string $id, Entity|array<string, float|int|string|null>|stdClass $data) : false|int|string
Parameters
- $id : int|string
- $data : Entity|array<string, float|int|string|null>|stdClass
Return values
false|int|string —The number of updated items or false if it could not be updated