mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-22 01:49:05 +02:00
Added an simple import system for attachment types.
This commit is contained in:
parent
b827737caa
commit
68aa750e00
7 changed files with 297 additions and 6 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue