. */ namespace App\Entity\Base; use App\Entity\Specifications\Specification; use Symfony\Component\Validator\Constraints as Assert; trait SpecificationsTrait { /** * @var Specification[] * @ORM\Column(type="json_document") * @Assert\Valid() */ protected $specifications = []; /** * Return all associated specifications * @return Specification[] */ public function getSpecifications(): array { return $this->specifications ?? []; } /** * @param array $specifications * @return $this */ public function setSpecifications(array $specifications): self { $this->specifications = $specifications; return $this; } }