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