Show a treeview in the admin menus, to select between the different elements.

This commit is contained in:
Jan Böhmer 2019-04-05 17:49:02 +02:00
parent 928b574d8c
commit 650b388a1d
16 changed files with 269 additions and 25 deletions

View file

@ -23,6 +23,7 @@ declare(strict_types=1);
namespace App\Entity;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
@ -33,9 +34,9 @@ abstract class AttachmentContainingDBElement extends NamedDBElement
/**
* @var
* //TODO
* //@ORM\OneToMany(targetEntity="Attachment", mappedBy="element")
* @ORM\OneToMany(targetEntity="Attachment", mappedBy="element")
*/
protected $attachment;
protected $attachments;
//TODO
protected $attachmentTypes;
@ -54,7 +55,7 @@ abstract class AttachmentContainingDBElement extends NamedDBElement
*
* @throws Exception if there was an error
*/
public function getAttachmentTypes(): array
public function getAttachmentTypes(): ?array
{
return $this->attachmentTypes;
}
@ -70,7 +71,7 @@ abstract class AttachmentContainingDBElement extends NamedDBElement
*
* @throws Exception if there was an error
*/
public function getAttachments($type_id = null, bool $only_table_attachements = false): array
public function getAttachments($type_id = null, bool $only_table_attachements = false) : Collection
{
if ($only_table_attachements || $type_id) {
$attachements = $this->attachments;