diff --git a/src/Entity/Devices/Device.php b/src/Entity/Devices/Device.php index 3b1931f3..e6ce5e8a 100644 --- a/src/Entity/Devices/Device.php +++ b/src/Entity/Devices/Device.php @@ -60,7 +60,7 @@ use InvalidArgumentException; /** * Class AttachmentType. * - * @ORM\Entity(repositoryClass="App\Repository\StructuralDBElementRepository") + * @ORM\Entity(repositoryClass="App\Repository\Parts\DeviceRepository") * @ORM\Table(name="`devices`") */ class Device extends AbstractPartsContainingDBElement diff --git a/src/Repository/Parts/DeviceRepository.php b/src/Repository/Parts/DeviceRepository.php new file mode 100644 index 00000000..1e6166a8 --- /dev/null +++ b/src/Repository/Parts/DeviceRepository.php @@ -0,0 +1,37 @@ + 'ASC']): array + { + if (!$element instanceof Device) { + throw new \InvalidArgumentException('$element must be an Device!'); + } + + + //TODO: Change this later, when properly implemented devices + return []; + } + + public function getPartsCount(object $element): int + { + if (!$element instanceof Device) { + throw new \InvalidArgumentException('$element must be an Device!'); + } + + //TODO: Change this later, when properly implemented devices + //Prevent user from deleting devices, to not accidentally remove filled devices from old versions + return 1; + } +} \ No newline at end of file