Aplus Framework Docs

ModelInterface
in

Interface ModelInterface.

Tags
see
https://en.wikipedia.org/wiki/Create,_read,_update_and_delete

Table of Contents

create()  : false|int|string
Create a new item.
delete()  : false|int|string
Delete based on id.
read()  : array<string, float|int|string|null>|Entity|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(array<string, float|int|string|null>|Entity|stdClass $data) : false|int|string
Parameters
$data : array<string, float|int|string|null>|Entity|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) : array<string, float|int|string|null>|Entity|stdClass|null
Parameters
$id : int|string
Tags
since
3.6
Return values
array<string, float|int|string|null>|Entity|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, array<string, float|int|string|null>|Entity|stdClass $data) : false|int|string
Parameters
$id : int|string
$data : array<string, float|int|string|null>|Entity|stdClass
Return values
false|int|string

The number of updated items or false if it could not be updated

Search results