src/Entity/Gos/Tmpl/TmplModuleContent.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos\Tmpl;
  3. use App\Entity\Gos\ProductAssociation;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass="App\Repository\TmplModuleContentRepository")
  7.  * @ORM\Table(name="tmpl_module_contents")
  8.  * @ORM\HasLifecycleCallbacks
  9.  */
  10. class TmplModuleContent
  11. {
  12.     /**
  13.      * @var int
  14.      *
  15.      * @ORM\Column(name="id", type="integer")
  16.      * @ORM\Id
  17.      * @ORM\GeneratedValue(strategy="AUTO")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @var string
  22.      * @ORM\Column(name="json", type="text")
  23.      */
  24.     private $json;
  25.     /**
  26.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\ProductAssociation", inversedBy="tmplModuleContents")
  27.      * @ORM\JoinColumn(nullable=true)
  28.      */
  29.     private $productAssociation;
  30.     /**
  31.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\Tmpl\TmplItem", inversedBy="tmplModuleContents")
  32.      * @ORM\JoinColumn(nullable=true)
  33.      */
  34.     private $tmplItem;
  35.     /**
  36.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\Tmpl\TmplModule")
  37.      * @ORM\JoinColumn(nullable=false)
  38.      */
  39.     private $tmplModule;
  40.     public function getDecodedJson()
  41.     {
  42.         return json_decode($this->getJson(), true);
  43.     }
  44.     public function setJsonFromArray(array $array): self
  45.     {
  46.         return $this->setJson(json_encode($array));
  47.     }
  48.     public function getId(): ?int
  49.     {
  50.         return $this->id;
  51.     }
  52.     public function getJson(): ?string
  53.     {
  54.         return $this->json;
  55.     }
  56.     public function setJson(string $json): self
  57.     {
  58.         $this->json $json;
  59.         return $this;
  60.     }
  61.     public function getTmplItem(): ?TmplItem
  62.     {
  63.         return $this->tmplItem;
  64.     }
  65.     public function setTmplItem(?TmplItem $tmplItem): self
  66.     {
  67.         $this->tmplItem $tmplItem;
  68.         return $this;
  69.     }
  70.     public function getTmplModule(): ?TmplModule
  71.     {
  72.         return $this->tmplModule;
  73.     }
  74.     public function setTmplModule(?TmplModule $tmplModule): self
  75.     {
  76.         $this->tmplModule $tmplModule;
  77.         return $this;
  78.     }
  79.     public function getProductAssociation(): ?ProductAssociation
  80.     {
  81.         return $this->productAssociation;
  82.     }
  83.     public function setProductAssociation(?ProductAssociation $productAssociation): self
  84.     {
  85.         $this->productAssociation $productAssociation;
  86.         return $this;
  87.     }
  88. }