mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 09:35:49 +02:00
Use imports instead of FQNs
This commit is contained in:
parent
f63b6d7207
commit
5629215ce4
179 changed files with 792 additions and 597 deletions
|
@ -116,7 +116,7 @@ class StructuralDBElementRepository extends NamedDBElementRepository
|
|||
$entity = $this->getNewEntityFromCache($name, $parent);
|
||||
|
||||
//See if we already have an element with this name and parent in the database
|
||||
if (!$entity instanceof \App\Entity\Base\AbstractStructuralDBElement) {
|
||||
if (!$entity instanceof AbstractStructuralDBElement) {
|
||||
$entity = $this->findOneBy(['name' => $name, 'parent' => $parent]);
|
||||
}
|
||||
if (null === $entity) {
|
||||
|
@ -138,7 +138,7 @@ class StructuralDBElementRepository extends NamedDBElementRepository
|
|||
|
||||
private function getNewEntityFromCache(string $name, ?AbstractStructuralDBElement $parent): ?AbstractStructuralDBElement
|
||||
{
|
||||
$key = $parent instanceof \App\Entity\Base\AbstractStructuralDBElement ? $parent->getFullPath('%->%').'%->%'.$name : $name;
|
||||
$key = $parent instanceof AbstractStructuralDBElement ? $parent->getFullPath('%->%').'%->%'.$name : $name;
|
||||
if (isset($this->new_entity_cache[$key])) {
|
||||
return $this->new_entity_cache[$key];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue