Fixed some incompatibility on PHP 7.4

This commit is contained in:
Jan Böhmer 2023-01-30 00:43:03 +01:00
parent e0c380d81a
commit 5ead9cbf61
2 changed files with 6 additions and 1 deletions

View file

@ -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);
}