item_service_interface
Public API Contract for item_service.
Extensions MUST depend on this interface instead of the concrete application service inside the Core.
Table of Contents
Methods
- create() : item_interface
- Create a new item.
- delete() : void
- Delete an item by its ID.
- find() : null|item_interface
- Find an item by ID.
- find_by_type() : array<string|int, item_interface>
- Retrieve all items of a given TYPE.
- get_metadata() : array<string, mixed>
- Retrieve metadata for an item.
- get_repository() : item_repository_interface
- Get the underlying repository instance.
- update() : item_interface
- Update an existing item.
Methods
create()
Create a new item.
public
create(item_dto_interface $dto) : item_interface
Parameters
- $dto : item_dto_interface
Return values
item_interfacedelete()
Delete an item by its ID.
public
delete(int $id) : void
Parameters
- $id : int
find()
Find an item by ID.
public
find(int $id) : null|item_interface
Parameters
- $id : int
Return values
null|item_interfacefind_by_type()
Retrieve all items of a given TYPE.
public
find_by_type(string $type) : array<string|int, item_interface>
Parameters
- $type : string
Return values
array<string|int, item_interface>get_metadata()
Retrieve metadata for an item.
public
get_metadata(int $id) : array<string, mixed>
Parameters
- $id : int
Return values
array<string, mixed>get_repository()
Get the underlying repository instance.
public
get_repository() : item_repository_interface
Use with caution; prefer service methods.
Return values
item_repository_interfaceupdate()
Update an existing item.
public
update(item_dto_interface $dto) : item_interface
Parameters
- $dto : item_dto_interface