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

@ -61,7 +61,10 @@ declare(strict_types=1);
namespace App\Entity\Parts;
use App\Entity\Attachments\Attachment;
use App\Entity\Attachments\FootprintAttachment;
use App\Entity\Base\PartsContainingDBElement;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
@ -72,6 +75,12 @@ use Doctrine\ORM\Mapping as ORM;
*/
class Footprint extends PartsContainingDBElement
{
/**
* @var Collection|FootprintAttachment[]
* @ORM\OneToMany(targetEntity="App\Entity\Attachments\FootprintAttachment", mappedBy="element")
*/
protected $attachments;
/**
* @ORM\OneToMany(targetEntity="Footprint", mappedBy="parent")
*/
@ -83,22 +92,17 @@ class Footprint extends PartsContainingDBElement
*/
protected $parent;
/**
* @var string
* @ORM\Column(type="text")
*/
protected $filename;
/**
* @ORM\OneToMany(targetEntity="Part", mappedBy="footprint", fetch="EXTRA_LAZY")
*/
protected $parts;
/**
* @var string
* @ORM\Column(type="text")
* @var FootprintAttachment
* @ORM\ManyToOne(targetEntity="App\Entity\Attachments\FootprintAttachment")
* @ORM\JoinColumn(name="id_footprint_3d", referencedColumnName="id")
*/
protected $filename_3d;
protected $footprint_3d;
/**
* Returns the ID as an string, defined by the element class.