mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-08 09:24:32 +02:00
Fixed an exception in type name generator.
This commit is contained in:
parent
bc8748e6f4
commit
8ef68fc8d7
1 changed files with 3 additions and 1 deletions
|
@ -48,6 +48,7 @@ use App\Entity\Base\AbstractDBElement;
|
||||||
use App\Entity\Base\AbstractNamedDBElement;
|
use App\Entity\Base\AbstractNamedDBElement;
|
||||||
use App\Entity\Contracts\NamedElementInterface;
|
use App\Entity\Contracts\NamedElementInterface;
|
||||||
use App\Entity\Devices\Device;
|
use App\Entity\Devices\Device;
|
||||||
|
use App\Entity\Parameters\AbstractParameter;
|
||||||
use App\Entity\Parts\Category;
|
use App\Entity\Parts\Category;
|
||||||
use App\Entity\Parts\Footprint;
|
use App\Entity\Parts\Footprint;
|
||||||
use App\Entity\Parts\Manufacturer;
|
use App\Entity\Parts\Manufacturer;
|
||||||
|
@ -92,6 +93,7 @@ class ElementTypeNameGenerator
|
||||||
Pricedetail::class => $this->translator->trans('pricedetail.label'),
|
Pricedetail::class => $this->translator->trans('pricedetail.label'),
|
||||||
Group::class => $this->translator->trans('group.label'),
|
Group::class => $this->translator->trans('group.label'),
|
||||||
User::class => $this->translator->trans('user.label'),
|
User::class => $this->translator->trans('user.label'),
|
||||||
|
AbstractParameter::class => $this->translator->trans('parameter.label')
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,7 +126,7 @@ class ElementTypeNameGenerator
|
||||||
}
|
}
|
||||||
|
|
||||||
//When nothing was found throw an exception
|
//When nothing was found throw an exception
|
||||||
throw new EntityNotSupportedException(sprintf('No localized label for the element with type %s was found!', get_class($entity)));
|
throw new EntityNotSupportedException(sprintf('No localized label for the element with type %s was found!', is_object($entity) ? get_class($entity) : (string) $entity));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue