Allow to add/delete attachments via part edit page.

This commit is contained in:
Jan Böhmer 2019-08-26 23:30:35 +02:00
parent fcfab982a8
commit 3a11933a89
12 changed files with 370 additions and 50 deletions

View file

@ -31,6 +31,7 @@
namespace App\Entity\Attachments;
use App\Entity\Parts\Part;
use Doctrine\ORM\Mapping as ORM;
/**
@ -48,4 +49,14 @@ class PartAttachment extends Attachment
*/
protected $element;
public function setElement(AttachmentContainingDBElement $element): Attachment
{
if (!$element instanceof Part) {
throw new \InvalidArgumentException("The element associated with a PartAttachment must be a Part!");
}
$this->element = $element;
return $this;
}
}