Added an simple import system for attachment types.

This commit is contained in:
Jan Böhmer 2019-04-11 22:41:21 +02:00
parent b827737caa
commit 68aa750e00
7 changed files with 297 additions and 6 deletions

View file

@ -23,6 +23,7 @@ declare(strict_types=1);
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\PersistentCollection;
use App\Validator\Constraints\NoneOfItsChildren;
@ -88,6 +89,13 @@ abstract class StructuralDBElement extends AttachmentContainingDBElement
*/
private $full_path_strings;
public function __construct()
{
$this->children = new ArrayCollection();
}
/******************************************************************************
* StructuralDBElement constructor.
*****************************************************************************/
@ -220,12 +228,12 @@ abstract class StructuralDBElement extends AttachmentContainingDBElement
*
* @return static[] all subelements as an array of objects (sorted by their full path)
*/
public function getSubelements(): PersistentCollection
public function getSubelements(): iterable
{
return $this->children;
}
public function getChildren(): PersistentCollection
public function getChildren(): iterable
{
return $this->children;
}
@ -264,4 +272,18 @@ abstract class StructuralDBElement extends AttachmentContainingDBElement
return $this;
}
public function setChildren(array $element) : self
{
$this->children = $element;
return $this;
}
public function clearChildren() : self
{
$this->children = new ArrayCollection();
return $this;
}
}