mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-12 11:24:31 +02:00
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:
parent
a6e0f1738b
commit
719e21c0df
35 changed files with 738 additions and 183 deletions
|
@ -52,8 +52,10 @@ namespace App\Entity\Parts;
|
|||
|
||||
use App\Entity\Attachments\Attachment;
|
||||
use App\Entity\Attachments\AttachmentContainingDBElement;
|
||||
use App\Entity\Base\SpecificationsTrait;
|
||||
use App\Entity\Parameters\ParametersTrait;
|
||||
use App\Entity\Devices\Device;
|
||||
use App\Entity\Parameters\DeviceParameter;
|
||||
use App\Entity\Parameters\PartParameter;
|
||||
use App\Entity\Parts\PartTraits\AdvancedPropertyTrait;
|
||||
use App\Entity\Parts\PartTraits\BasicPropertyTrait;
|
||||
use App\Entity\Parts\PartTraits\InstockTrait;
|
||||
|
@ -82,13 +84,19 @@ class Part extends AttachmentContainingDBElement
|
|||
use InstockTrait;
|
||||
use ManufacturerTrait;
|
||||
use OrderTrait;
|
||||
use SpecificationsTrait;
|
||||
use ParametersTrait;
|
||||
|
||||
/**
|
||||
* TODO.
|
||||
*/
|
||||
protected $devices = [];
|
||||
|
||||
/** @var PartParameter[]
|
||||
* @Assert\Valid()
|
||||
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\PartParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
|
||||
*/
|
||||
protected $parameters;
|
||||
|
||||
/**
|
||||
* @ColumnSecurity(type="datetime")
|
||||
* @ORM\Column(type="datetime", name="datetime_added", options={"default"="CURRENT_TIMESTAMP"})
|
||||
|
@ -134,6 +142,7 @@ class Part extends AttachmentContainingDBElement
|
|||
parent::__construct();
|
||||
$this->partLots = new ArrayCollection();
|
||||
$this->orderdetails = new ArrayCollection();
|
||||
$this->parameters = new ArrayCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue