src/Entity/System/Attribute.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity\System;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * Attribute
  8.  *
  9.  * @ORM\Table(name="ps_attribute")
  10.  *
  11.  * @ORM\Entity(repositoryClass="App\Repository\System\AttributeRepository")
  12.  */
  13. class Attribute
  14. {
  15.     /**
  16.      * @var int
  17.      *
  18.      * @ORM\Column(name="id_attribute", type="integer")
  19.      *
  20.      * @ORM\Id
  21.      */
  22.     private $id;
  23.     /**
  24.      * @var AttributeLang[]|ArrayCollection<int, AttributeLang>
  25.      *
  26.      * @ORM\OneToMany(targetEntity="App\Entity\System\AttributeLang", mappedBy="attribute", cascade={"persist"})
  27.      */
  28.     private $attributeLangs;
  29.     /**
  30.      * @var AttributeGroup
  31.      *
  32.      * @ORM\ManyToOne(targetEntity="App\Entity\System\AttributeGroup", inversedBy="attributes")
  33.      *
  34.      * @ORM\JoinColumn(nullable=false, referencedColumnName="id_attribute_group", name="id_attribute_group")
  35.      */
  36.     private $attributeGroup;
  37.     /**
  38.      * @var \DateTime
  39.      *
  40.      * @ORM\Column(type="datetime")
  41.      */
  42.     private $dateAdd;
  43.     /**
  44.      * @var \DateTime
  45.      *
  46.      * @ORM\Column(type="datetime")
  47.      */
  48.     private $dateUpd;
  49.     public function __construct()
  50.     {
  51.         $this->dateAdd = new \DateTime();
  52.     }
  53.     public function getId(): int
  54.     {
  55.         return $this->id;
  56.     }
  57.     public function setId(int $id): Attribute
  58.     {
  59.         $this->id $id;
  60.         return $this;
  61.     }
  62.     /**
  63.      * @return AttributeLang[]|ArrayCollection<int, AttributeLang>
  64.      */
  65.     public function getAttributeLangs()
  66.     {
  67.         return $this->attributeLangs;
  68.     }
  69.     /**
  70.      * @param Collection<string, AttributeLang> $attributeLangs
  71.      */
  72.     public function setAttributeLangs(Collection $attributeLangs): Attribute
  73.     {
  74.         $this->attributeLangs $attributeLangs;
  75.         return $this;
  76.     }
  77.     public function getAttributeGroup(): AttributeGroup
  78.     {
  79.         return $this->attributeGroup;
  80.     }
  81.     public function setAttributeGroup(AttributeGroup $attributeGroup): Attribute
  82.     {
  83.         $this->attributeGroup $attributeGroup;
  84.         return $this;
  85.     }
  86.     public function getDateAdd(): \DateTime
  87.     {
  88.         return $this->dateAdd;
  89.     }
  90.     public function setDateAdd(\DateTime $dateAdd): Attribute
  91.     {
  92.         $this->dateAdd $dateAdd;
  93.         return $this;
  94.     }
  95.     public function getDateUpd(): \DateTime
  96.     {
  97.         return $this->dateUpd;
  98.     }
  99.     public function setDateUpd(\DateTime $dateUpd): Attribute
  100.     {
  101.         $this->dateUpd $dateUpd;
  102.         return $this;
  103.     }
  104. }