Added possibility to create nested structures of elements using Mass Import

This commit is contained in:
Jan Böhmer 2023-01-28 23:24:45 +01:00
parent 22950f2476
commit 07f95bc6ea
7 changed files with 126 additions and 12 deletions

View file

@ -148,9 +148,20 @@ abstract class AbstractStructuralDBElement extends AttachmentContainingDBElement
return false;
}
//If this' parents element, is $another_element, then we are finished
return ($this->parent->getID() === $another_element->getID())
|| $this->parent->isChildOf($another_element); //Otherwise, check recursively
//If the parent element is equal to the element we want to compare, return true
if ($this->getParent()->getID() === null || $this->getParent()->getID() === null) {
//If the IDs are not yet defined, we have to compare the objects itself
if ($this->getParent() === $another_element) {
return true;
}
} else { //If the IDs are defined, we can compare the IDs
if ($this->getParent()->getID() === $another_element->getID()) {
return true;
}
}
//Otherwise, check recursively
return $this->parent->isChildOf($another_element);
}
/**

View file

@ -83,7 +83,7 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
* @ORM\Column(type="string", name="config_theme", nullable=true)
* @Assert\Choice(choices=User::AVAILABLE_THEMES)
*/
protected ?string $theme = '';
protected ?string $theme = null;
/**
* @var string|null the hash of a token the user must provide when he wants to reset his password