src/Entity/System/AttributeLang.php line 20

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity\System;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Table(
  7.  *     name="ps_attribute_lang",
  8.  *         uniqueConstraints={
  9.  *
  10.  *              @ORM\UniqueConstraint(name="uk_attribute_language", columns={"attribute_id", "language_id"})
  11.  *         }
  12.  *   )
  13.  *
  14.  * @ORM\Entity(repositoryClass="App\Repository\System\AttributeLangRepository")
  15.  */
  16. class AttributeLang
  17. {
  18.     /**
  19.      * @var int
  20.      *
  21.      * @ORM\Column(type="integer")
  22.      *
  23.      * @ORM\Id
  24.      *
  25.      * @ORM\GeneratedValue(strategy="AUTO")
  26.      */
  27.     private $id;
  28.     /**
  29.      * @var Language
  30.      *
  31.      * @ORM\ManyToOne(targetEntity="App\Entity\System\Language")
  32.      *
  33.      * @ORM\JoinColumn(referencedColumnName="id_lang")
  34.      */
  35.     private $language;
  36.     /**
  37.      * @var Attribute
  38.      *
  39.      * @ORM\ManyToOne(targetEntity="App\Entity\System\Attribute", inversedBy="attributeLangs", cascade={"persist"})
  40.      *
  41.      * @ORM\JoinColumn(referencedColumnName="id_attribute")
  42.      */
  43.     private $attribute;
  44.     /**
  45.      * @var string
  46.      *
  47.      * @ORM\Column(type="string", length=100)
  48.      */
  49.     private $name;
  50.     public function getId(): ?int
  51.     {
  52.         return $this->id;
  53.     }
  54.     public function setId(int $id): AttributeLang
  55.     {
  56.         $this->id $id;
  57.         return $this;
  58.     }
  59.     public function getLanguage(): Language
  60.     {
  61.         return $this->language;
  62.     }
  63.     public function setLanguage(Language $language): AttributeLang
  64.     {
  65.         $this->language $language;
  66.         return $this;
  67.     }
  68.     public function getAttribute(): Attribute
  69.     {
  70.         return $this->attribute;
  71.     }
  72.     public function setAttribute(Attribute $attribute): AttributeLang
  73.     {
  74.         $this->attribute $attribute;
  75.         return $this;
  76.     }
  77.     public function getName(): string
  78.     {
  79.         return $this->name;
  80.     }
  81.     public function setName(string $name): AttributeLang
  82.     {
  83.         $this->name $name;
  84.         return $this;
  85.     }
  86. }