mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-23 18:28:49 +02:00
Added some basic DB fields for the new project system
This commit is contained in:
parent
8ae4e9fe05
commit
0c7ec9f0c7
36 changed files with 281 additions and 130 deletions
|
@ -22,18 +22,19 @@ namespace App\Repository\Parts;
|
|||
|
||||
|
||||
use App\Entity\Base\AbstractPartsContainingDBElement;
|
||||
use App\Entity\Devices\Device;
|
||||
use App\Entity\ProjectSystem\Project;
|
||||
use App\Entity\Parts\Category;
|
||||
use App\Entity\Parts\Part;
|
||||
use App\Repository\AbstractPartsContainingRepository;
|
||||
use App\Repository\StructuralDBElementRepository;
|
||||
use InvalidArgumentException;
|
||||
|
||||
class DeviceRepository extends AbstractPartsContainingRepository
|
||||
class DeviceRepository extends StructuralDBElementRepository
|
||||
{
|
||||
|
||||
public function getParts(object $element, array $order_by = ['name' => 'ASC']): array
|
||||
{
|
||||
if (!$element instanceof Device) {
|
||||
if (!$element instanceof Project) {
|
||||
throw new InvalidArgumentException('$element must be an Device!');
|
||||
}
|
||||
|
||||
|
@ -44,7 +45,7 @@ class DeviceRepository extends AbstractPartsContainingRepository
|
|||
|
||||
public function getPartsCount(object $element): int
|
||||
{
|
||||
if (!$element instanceof Device) {
|
||||
if (!$element instanceof Project) {
|
||||
throw new InvalidArgumentException('$element must be an Device!');
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue