mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-18 16:49:00 +02:00
parent
f32ae8bc6c
commit
50cca40f77
9 changed files with 998 additions and 928 deletions
|
@ -20,17 +20,27 @@
|
|||
|
||||
namespace App\Repository\Parts;
|
||||
|
||||
use App\Entity\Parts\Footprint;
|
||||
use App\Entity\Parts\Storelocation;
|
||||
use App\Repository\AbstractPartsContainingRepository;
|
||||
|
||||
class FootprintRepository extends AbstractPartsContainingRepository
|
||||
{
|
||||
public function getParts(object $element, array $order_by = ['name' => 'ASC']): array
|
||||
{
|
||||
if(!$element instanceof Footprint) {
|
||||
throw new \InvalidArgumentException('$element must be an Footprint!');
|
||||
}
|
||||
|
||||
return $this->getPartsByField($element, $order_by, 'footprint');
|
||||
}
|
||||
|
||||
public function getPartsCount(object $element): int
|
||||
{
|
||||
if(!$element instanceof Footprint) {
|
||||
throw new \InvalidArgumentException('$element must be an Footprint!');
|
||||
}
|
||||
|
||||
return $this->getPartsCountByField($element, 'footprint');
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue