ordered by unit index */ public function findByOrderItem(int $orderItemId): array; public function get(int $id): ?CoveredUnit; /** Persists a new unit with its events and assigns its id. */ public function insert(CoveredUnit $unit): void; /** * Persists changes and pending events. * * @throws DomainError 409 unit_busy when another claim holds the unit * (checked first, so a race on G07 gets the clear error), else * 409 version_conflict when the unit changed since it was loaded. */ public function save(CoveredUnit $unit): void; }