Changed DB structure the way, many more elements can have attachments

Also every Element has now a preview attachment field. For the user this will be used as profile picture.
This commit is contained in:
Jan Böhmer 2019-09-24 13:39:49 +02:00
parent 5061c29872
commit ccc345cd1b
28 changed files with 985 additions and 28 deletions

View file

@ -35,7 +35,7 @@ use App\Entity\Parts\Part;
use Doctrine\ORM\Mapping as ORM;
/**
* Class PartAttachment
* A attachment attached to a part element.
* @package App\Entity
* @ORM\Entity()
*/
@ -43,7 +43,7 @@ class PartAttachment extends Attachment
{
/**
*
* @var Part The element this attachment is associated with.
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Part", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
*/
@ -56,7 +56,6 @@ class PartAttachment extends Attachment
}
$this->element = $element;
return $this;
}
}