Save element parameters in its own database table (dont use JSON)

This makes it easier to query for specific parameters.
This commit is contained in:
Jan Böhmer 2020-03-11 21:48:47 +01:00
parent a6e0f1738b
commit 719e21c0df
35 changed files with 738 additions and 183 deletions

View file

@ -52,8 +52,11 @@ namespace App\Entity\Parts;
use App\Entity\Attachments\StorelocationAttachment;
use App\Entity\Base\AbstractPartsContainingDBElement;
use App\Entity\Parameters\DeviceParameter;
use App\Entity\Parameters\StorelocationParameter;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Class Store location.
@ -85,11 +88,17 @@ class Storelocation extends AbstractPartsContainingDBElement
* @ORM\ManyToMany(targetEntity="Part", fetch="EXTRA_LAZY")
* @ORM\JoinTable(name="part_lots",
* joinColumns={@ORM\JoinColumn(name="id_store_location", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="id_part", referencedColumnName="id")}
* inverseJoinColumns={@ORM\JoinColumn(name="id_part", referencedColumnName="id")}
* )
*/
protected $parts;
/** @var StorelocationParameter[]
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\StorelocationParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @Assert\Valid()
*/
protected $parameters;
/**
* @var bool
* @ORM\Column(type="boolean")
@ -110,6 +119,7 @@ class Storelocation extends AbstractPartsContainingDBElement
/**
* @var Collection|StorelocationAttachment[]
* @ORM\OneToMany(targetEntity="App\Entity\Attachments\StorelocationAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @Assert\Valid()
*/
protected $attachments;