ModelInterface interface

Framework\MVC\ModelInterface

Interface ModelInterface.

Defined in libraries/mvc/src/ModelInterface.php

Methods #

create()
Create a new item.
delete()
Delete based on id.
read()
Read an item based on id.
update()
Update based on id and return the number of updated items.

create()

public function create(\Framework\MVC\Entity|stdClass|array $data): string|int|false

Create a new item.

Parameters
  • \Framework\MVC\Entity|stdClass|array $data
Returns string|int|false - The created item id on success or false if it could not be created

delete()

public function delete(string|int $id): string|int|false

Delete based on id.

Parameters
  • string|int $id
Returns string|int|false - The number of deleted items or false if it could not be deleted

read()

public function read(string|int $id): \Framework\MVC\Entity|stdClass|array|null

Read an item based on id.

Parameters
  • string|int $id
Returns \Framework\MVC\Entity|stdClass|array|null - The item as array, Entity or stdClass or null if the item was not found

update()

public function update(string|int $id, \Framework\MVC\Entity|stdClass|array $data): string|int|false

Update based on id and return the number of updated items.

Parameters
  • string|int $id
  • \Framework\MVC\Entity|stdClass|array $data
Returns string|int|false - The number of updated items or false if it could not be updated