21 lines
490 B
PHP
21 lines
490 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Modules\Machines\Domain\Contracts;
|
|
|
|
use App\Modules\Machines\Domain\Entities\Machine;
|
|
|
|
interface MachineRepository
|
|
{
|
|
public function findById(int $id): ?Machine;
|
|
|
|
/**
|
|
* Saves the machine with its service units and counters; counters left
|
|
* out are removed when nothing refers to them.
|
|
*/
|
|
public function save(Machine $machine): Machine;
|
|
|
|
public function isNameTaken(string $name, ?int $exceptId = null): bool;
|
|
}
|