item_mapper
class item_mapper extends abstract_mapper
| internal |
Item mapper for domain items.
Responsible for converting between:
- DB record (stdClass) + Meta Array → Domain Item Entity
- Domain Item Entity → DB record (stdClass)
- Domain Item + DTO → New Domain Item (Immutable update)
No business logic should exist here — this class performs pure data mapping.
Methods
db_to_domain(stdClass $record, array $metadata)
Convert from DB record (with metadata) to a Domain Item.
apply_dto(item_interface $old, item_dto $dto)
Apply DTO onto an existing domain item, returning a cloned immutable copy.
Details
at line 53
entity_interface
db_to_domain(stdClass $record, array $metadata)
Convert from DB record (with metadata) to a Domain Item.
at line 98
stdClass
domain_to_db(entity_interface $entity)
Convert from domain item to DB record (stdClass).
Note: does NOT map metadata, as that is stored in a separate table.
at line 138
item_interface
apply_dto(item_interface $old, item_dto $dto)
Apply DTO onto an existing domain item, returning a cloned immutable copy.