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

@ -44,10 +44,13 @@ namespace App\Entity\UserSystem;
use App\Entity\Attachments\GroupAttachment;
use App\Entity\Base\AbstractStructuralDBElement;
use App\Entity\Parameters\GroupParameter;
use App\Entity\Parameters\SupplierParameter;
use App\Security\Interfaces\HasPermissionsInterface;
use App\Validator\Constraints\ValidPermission;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* This entity represents an user group.
@ -81,6 +84,7 @@ class Group extends AbstractStructuralDBElement implements HasPermissionsInterfa
/**
* @var Collection|GroupAttachment[]
* @ORM\OneToMany(targetEntity="App\Entity\Attachments\ManufacturerAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @Assert\Valid()
*/
protected $attachments;
@ -90,6 +94,12 @@ class Group extends AbstractStructuralDBElement implements HasPermissionsInterfa
*/
protected $permissions;
/** @var GroupParameter[]
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\GroupParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @Assert\Valid()
*/
protected $parameters;
public function __construct()
{
parent::__construct();