<?phpnamespace App\Entity\Gos\Tmpl;use App\Entity\Gos\ProductAssociation;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass="App\Repository\TmplModuleContentRepository") * @ORM\Table(name="tmpl_module_contents") * @ORM\HasLifecycleCallbacks */class TmplModuleContent{ /** * @var int * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @var string * @ORM\Column(name="json", type="text") */ private $json; /** * @ORM\ManyToOne(targetEntity="App\Entity\Gos\ProductAssociation", inversedBy="tmplModuleContents") * @ORM\JoinColumn(nullable=true) */ private $productAssociation; /** * @ORM\ManyToOne(targetEntity="App\Entity\Gos\Tmpl\TmplItem", inversedBy="tmplModuleContents") * @ORM\JoinColumn(nullable=true) */ private $tmplItem; /** * @ORM\ManyToOne(targetEntity="App\Entity\Gos\Tmpl\TmplModule") * @ORM\JoinColumn(nullable=false) */ private $tmplModule; public function getDecodedJson() { return json_decode($this->getJson(), true); } public function setJsonFromArray(array $array): self { return $this->setJson(json_encode($array)); } public function getId(): ?int { return $this->id; } public function getJson(): ?string { return $this->json; } public function setJson(string $json): self { $this->json = $json; return $this; } public function getTmplItem(): ?TmplItem { return $this->tmplItem; } public function setTmplItem(?TmplItem $tmplItem): self { $this->tmplItem = $tmplItem; return $this; } public function getTmplModule(): ?TmplModule { return $this->tmplModule; } public function setTmplModule(?TmplModule $tmplModule): self { $this->tmplModule = $tmplModule; return $this; } public function getProductAssociation(): ?ProductAssociation { return $this->productAssociation; } public function setProductAssociation(?ProductAssociation $productAssociation): self { $this->productAssociation = $productAssociation; return $this; }}