item_service
class item_service implements item_service_interface
| internal |
Item application service.
Orchestrates the lifecycle of Items: CRUD, validation, auditing, and versioning. This represents the write model in a CQRS-lite approach.
Methods
__construct(item_repository_interface $repository, event_service_interface $event_service, revision_service_interface $revision_service, item_validator_service_interface $validator)
Constructor.
void
delete(int $id)
Delete an item.
item_interface|null
find(int $id)
Find an item by ID.
array
get_metadata(int $id)
Retrieve metadata for an item.
array
find_by_type(string $type)
Retrieve all items for the given TYPE.
get_repository()
Expose underlying repository (primarily for advanced orchestration).
Details
at line 50
__construct(item_repository_interface $repository, event_service_interface $event_service, revision_service_interface $revision_service, item_validator_service_interface $validator)
Constructor.
at line 67
item_interface
create(item_dto_interface $dto)
Create a new item based on a DTO.
at line 99
item_interface
update(item_dto_interface $dto)
Update an existing item using a DTO.
at line 135
void
delete(int $id)
Delete an item.
at line 156
item_interface|null
find(int $id)
Find an item by ID.
at line 170
array
get_metadata(int $id)
Retrieve metadata for an item.
at line 183
array
find_by_type(string $type)
Retrieve all items for the given TYPE.
Used by extensions implementing the TYPE pattern.
at line 191
item_repository_interface
get_repository()
Expose underlying repository (primarily for advanced orchestration).