src/Admin/Entity/StdBlocks.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Admin\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * StdPages
  6.  */
  7. #[ORM\Table(name'std_blocks')]
  8. #[ORM\Index(name'fk_std_blocks_std_users'columns: ['created_by'])]
  9. #[ORM\Index(name'fk_std_blocks_std_users_0'columns: ['updated_by'])]
  10. #[ORM\Entity(repositoryClass'App\Admin\Repository\StdBlocksRepository')]
  11. class StdBlocks
  12. {
  13.     /**
  14.      * @var int
  15.      */
  16.     #[ORM\Column(name'id'type'integer'nullablefalseoptions: ['unsigned' => true'comment' => 'Unique identifier'])]
  17.     #[ORM\Id]
  18.     #[ORM\GeneratedValue(strategy'IDENTITY')]
  19.     private $id;
  20.     /**
  21.      * @var string
  22.      */
  23.     #[ORM\Column(name'machine_name'type'string'length50nullabletrueuniquetrueoptions: ['comment' => 'Unique code used in the programming to identify the block'])]
  24.     private $machineName;
  25.     /**
  26.      * @var bool
  27.      */
  28.     #[ORM\Column(name'is_active'type'boolean'nullabletrueoptions: ['default' => 1'comment' => 'Flag that indicates if the block is active'])]
  29.     private $isActive '1';
  30.     /**
  31.      * @var \StdUsers
  32.      */
  33.     #[ORM\JoinColumn(name'created_by'referencedColumnName'id')]
  34.     #[ORM\ManyToOne(targetEntity'StdUsers')]
  35.     private $createdBy;
  36.     /**
  37.      * @var \DateTime
  38.      */
  39.     #[ORM\Column(name'created_date'type'datetime'nullablefalseoptions: ['comment' => 'Date and time of the record creation'])]
  40.     private $createdDate;
  41.     /**
  42.      * @var \StdUsers
  43.      */
  44.     #[ORM\JoinColumn(name'updated_by'referencedColumnName'id')]
  45.     #[ORM\ManyToOne(targetEntity'StdUsers')]
  46.     private $updatedBy;
  47.     /**
  48.      * @var \DateTime
  49.      */
  50.     #[ORM\Column(name'updated_date'type'datetime'nullablefalseoptions: ['comment' => 'Date and time the record was last updated'])]
  51.     private $updatedDate;
  52.     /**
  53.      * @var string
  54.      */
  55.     #[ORM\Column(name'name'type'string'length100nullabletrueoptions: ['comment' => 'Name of the block'])]
  56.     private $name;
  57.     /**
  58.      * @var json
  59.      */
  60.     #[ORM\Column(name'settings'type'json'nullabletrueoptions: ['comment' => 'Block settings'])]
  61.     private $settings = [];
  62.     public function getId(): ?int
  63.     {
  64.         return $this->id;
  65.     }
  66.     public function getMachineName(): ?string
  67.     {
  68.         return $this->machineName;
  69.     }
  70.     public function setMachineName(string $machineName): self
  71.     {
  72.         $this->machineName $machineName;
  73.         return $this;
  74.     }
  75.     public function getIsActive(): ?bool
  76.     {
  77.         return $this->isActive;
  78.     }
  79.     public function setIsActive(bool $isActive): self
  80.     {
  81.         $this->isActive $isActive;
  82.         return $this;
  83.     }
  84.     public function getCreatedDate(): ?\DateTimeInterface
  85.     {
  86.         return $this->createdDate;
  87.     }
  88.     public function setCreatedDate(\DateTimeInterface $createdDate): self
  89.     {
  90.         $this->createdDate $createdDate;
  91.         return $this;
  92.     }
  93.     public function getUpdatedDate(): ?\DateTimeInterface
  94.     {
  95.         return $this->updatedDate;
  96.     }
  97.     public function setUpdatedDate(\DateTimeInterface $updatedDate): self
  98.     {
  99.         $this->updatedDate $updatedDate;
  100.         return $this;
  101.     }
  102.     public function getCreatedBy(): ?StdUsers
  103.     {
  104.         return $this->createdBy;
  105.     }
  106.     public function setCreatedBy(?StdUsers $createdBy): self
  107.     {
  108.         $this->createdBy $createdBy;
  109.         return $this;
  110.     }
  111.     public function getUpdatedBy(): ?StdUsers
  112.     {
  113.         return $this->updatedBy;
  114.     }
  115.     public function setUpdatedBy(?StdUsers $updatedBy): self
  116.     {
  117.         $this->updatedBy $updatedBy;
  118.         return $this;
  119.     }
  120.     public function getName(): ?string
  121.     {
  122.         return $this->name;
  123.     }
  124.     public function setName(string $name): self
  125.     {
  126.         $this->name $name;
  127.         return $this;
  128.     }
  129.     public function getSettings(): ?Array
  130.     {
  131.         return $this->settings;
  132.     }
  133.     public function setSettings(Array $settings): self
  134.     {
  135.         $this->settings $settings;
  136.         return $this;
  137.     }
  138.      #[ORM\PreUpdate]
  139.     public function setUpdated()
  140.     {
  141.         $this->setUpdatedDate(new \DateTime());
  142.     }
  143.     
  144.     #[ORM\PrePersist]
  145.     public function setCreated()
  146.     {
  147.         $this->setUpdatedDate(new \DateTime());
  148.         $this->setCreatedDate(new \DateTime());
  149.     }
  150.     public function __toString() {
  151.         return $this->name;
  152.     }
  153. }