mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 09:35:49 +02:00
Fixed some incompatibility on PHP 7.4
This commit is contained in:
parent
e0c380d81a
commit
5ead9cbf61
2 changed files with 6 additions and 1 deletions
|
@ -79,6 +79,10 @@ class CurrencyEntityType extends StructuralEntityType
|
|||
{
|
||||
$tmp = parent::generateChoiceAttr($choice, $key, $value, $options);
|
||||
|
||||
if (!$choice instanceof Currency) {
|
||||
throw new RuntimeException('The choice must be an instance of '.Currency::class);
|
||||
}
|
||||
|
||||
if(!empty($choice->getIsoCode())) {
|
||||
$symbol = Currencies::getSymbol($choice->getIsoCode());
|
||||
} else {
|
||||
|
|
|
@ -111,8 +111,9 @@ class StructuralDBElementRepository extends NamedDBElementRepository
|
|||
//See if we already have an element with this name and parent
|
||||
$entity = $this->findOneBy(['name' => $name, 'parent' => $parent]);
|
||||
if (null === $entity) {
|
||||
$class = $this->getClassName();
|
||||
/** @var AbstractStructuralDBElement $entity */
|
||||
$entity = new ($this->getClassName());
|
||||
$entity = new $class;
|
||||
$entity->setName($name);
|
||||
$entity->setParent($parent);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue