. */ namespace App\Repository\Parts; use App\Entity\Parts\Manufacturer; use App\Repository\AbstractPartsContainingRepository; use InvalidArgumentException; class ManufacturerRepository extends AbstractPartsContainingRepository { public function getParts(object $element, string $nameOrderDirection = "ASC"): array { if (!$element instanceof Manufacturer) { throw new InvalidArgumentException('$element must be an Manufacturer!'); } return $this->getPartsByField($element, $nameOrderDirection, 'manufacturer'); } public function getPartsCount(object $element): int { if (!$element instanceof Manufacturer) { throw new InvalidArgumentException('$element must be an Manufacturer!'); } return $this->getPartsCountByField($element, 'manufacturer'); } }