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\ManufacturerAttachment;
use App\Entity\Base\AbstractCompany;
use App\Entity\Parameters\DeviceParameter;
use App\Entity\Parameters\ManufacturerParameter;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Class Manufacturer.
@ -81,9 +84,16 @@ class Manufacturer extends AbstractCompany
/**
* @var Collection|ManufacturerAttachment[]
* @ORM\OneToMany(targetEntity="App\Entity\Attachments\ManufacturerAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @Assert\Valid()
*/
protected $attachments;
/** @var ManufacturerParameter[]
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\ManufacturerParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @Assert\Valid()
*/
protected $parameters;
/**
* Returns the ID as an string, defined by the element class.
* This should have a form like P000014, for a part with ID 14.