src/Admin/Entity/StdAttributesContent.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Admin\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * StdAttributesContent
  6.  * */
  7. #[ORM\Table(name'std_attributes_content')]
  8. #[ORM\Index(name'fk_std_attributes_std_users'columns: ['created_by'])]
  9. #[ORM\Index(name'fk_std_attributes_std_users_0'columns: ['updated_by'])]
  10. #[ORM\Entity]
  11. #[ORM\HasLifecycleCallbacks]
  12. class StdAttributesContent
  13. {
  14.     /**
  15.      * @var int
  16.      */
  17.     #[ORM\Column(name'id'type'integer'nullablefalseoptions: ['unsigned' => true'comment' => 'Attribute content unique identifier'])]
  18.     #[ORM\Id]
  19.     #[ORM\GeneratedValue(strategy'IDENTITY')]
  20.     private $id;
  21.     /**
  22.      * @var \StdAttributes
  23.      */
  24.     #[ORM\JoinColumn(name'attribute_id'referencedColumnName'id')]
  25.     #[ORM\ManyToOne(targetEntity'StdAttributes'inversedBy'contents')]
  26.     private $attribute;
  27.     /**
  28.      * @var \StdLanguages
  29.      */
  30.     #[ORM\JoinColumn(name'language_code'referencedColumnName'language_code')]
  31.     #[ORM\ManyToOne(targetEntity'StdLanguages')]
  32.     private $languageCode;
  33.     /**
  34.      * @var string
  35.      */
  36.     #[ORM\Column(name'name'type'string'length50nullablefalseoptions: ['comment' => 'Attribute name'])]
  37.     private $name;
  38.     /**
  39.      * @var \StdUsers
  40.      */
  41.     #[ORM\JoinColumn(name'created_by'referencedColumnName'id')]
  42.     #[ORM\ManyToOne(targetEntity'StdUsers')]
  43.     private $createdBy;
  44.     /**
  45.      * @var \DateTime
  46.      */
  47.     #[ORM\Column(name'created_date'type'datetime'nullablefalseoptions: ['comment' => 'Date and time of the record creation'])]
  48.     private $createdDate;
  49.     /**
  50.      * @var \StdUsers
  51.      */
  52.     #[ORM\JoinColumn(name'updated_by'referencedColumnName'id')]
  53.     #[ORM\ManyToOne(targetEntity'StdUsers')]
  54.     private $updatedBy;
  55.     /**
  56.      * @var \DateTime
  57.      */
  58.     #[ORM\Column(name'updated_date'type'datetime'nullablefalseoptions: ['comment' => 'Date and time the record was last updated'])]
  59.     private $updatedDate;
  60.     public function getId(): ?int
  61.     {
  62.         return $this->id;
  63.     }
  64.     public function getAttribute(): ?StdAttributes
  65.     {
  66.         return $this->attribute;
  67.     }
  68.     public function setAttribute(StdAttributes $attribute): self
  69.     {
  70.         $this->attribute $attribute;
  71.         return $this;
  72.     }
  73.     public function getLanguageCode(): ?StdLanguages
  74.     {
  75.         return $this->languageCode;
  76.     }
  77.     public function setLanguageCode(StdLanguages $languagecode): self
  78.     {
  79.         $this->languageCode $languagecode;
  80.         return $this;
  81.     }
  82.     public function getName(): ?string
  83.     {
  84.         return $this->name;
  85.     }
  86.     public function setName(string $name): self
  87.     {
  88.         $this->name $name;
  89.         return $this;
  90.     }
  91.     public function getCreatedDate(): ?\DateTimeInterface
  92.     {
  93.         return $this->createdDate;
  94.     }
  95.     public function setCreatedDate(\DateTimeInterface $createdDate): self
  96.     {
  97.         $this->createdDate $createdDate;
  98.         return $this;
  99.     }
  100.     public function getUpdatedDate(): ?\DateTimeInterface
  101.     {
  102.         return $this->updatedDate;
  103.     }
  104.     public function setUpdatedDate(\DateTimeInterface $updatedDate): self
  105.     {
  106.         $this->updatedDate $updatedDate;
  107.         return $this;
  108.     }
  109.     public function getCreatedBy(): ?StdUsers
  110.     {
  111.         return $this->createdBy;
  112.     }
  113.     public function setCreatedBy(?StdUsers $createdBy): self
  114.     {
  115.         $this->createdBy $createdBy;
  116.         return $this;
  117.     }
  118.     public function getUpdatedBy(): ?StdUsers
  119.     {
  120.         return $this->updatedBy;
  121.     }
  122.     public function setUpdatedBy(?StdUsers $updatedBy): self
  123.     {
  124.         $this->updatedBy $updatedBy;
  125.         return $this;
  126.     }
  127.      #[ORM\PreUpdate]
  128.     public function setUpdated()
  129.     {
  130.         $this->setUpdatedDate(new \DateTime());
  131.     }
  132.     
  133.     #[ORM\PrePersist]
  134.     public function setCreated()
  135.     {
  136.         $this->setUpdatedDate(new \DateTime());
  137.         $this->setCreatedDate(new \DateTime());
  138.     }
  139.     public function __toString() {
  140.         return $this->name;
  141.     }
  142. }