mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-24 18:58:46 +02:00
Fixed some inspection issues.
This commit is contained in:
parent
eef26f7ae6
commit
639829f5c5
97 changed files with 305 additions and 185 deletions
|
@ -26,6 +26,7 @@ namespace App\Repository;
|
|||
use App\Entity\LabelSystem\LabelOptions;
|
||||
use App\Entity\LabelSystem\LabelProfile;
|
||||
use App\Helpers\Trees\TreeViewNode;
|
||||
use InvalidArgumentException;
|
||||
|
||||
class LabelProfileRepository extends NamedDBElementRepository
|
||||
{
|
||||
|
@ -36,7 +37,7 @@ class LabelProfileRepository extends NamedDBElementRepository
|
|||
public function getDropdownProfiles(string $type): array
|
||||
{
|
||||
if (!in_array($type, LabelOptions::SUPPORTED_ELEMENTS, true)) {
|
||||
throw new \InvalidArgumentException('Invalid supported_element type given.');
|
||||
throw new InvalidArgumentException('Invalid supported_element type given.');
|
||||
}
|
||||
|
||||
return $this->findBy([
|
||||
|
@ -85,7 +86,7 @@ class LabelProfileRepository extends NamedDBElementRepository
|
|||
public function findForSupportedElement(string $type, array $order_by = ['name' => 'ASC']): array
|
||||
{
|
||||
if (!in_array($type, LabelOptions::SUPPORTED_ELEMENTS, true)) {
|
||||
throw new \InvalidArgumentException('Invalid supported_element type given.');
|
||||
throw new InvalidArgumentException('Invalid supported_element type given.');
|
||||
}
|
||||
|
||||
return $this->findBy(['options.supported_element' => $type], $order_by);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue