src/Entity/System/CountryLanguage.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity\System;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * @ORM\Entity(repositoryClass="App\Repository\System\CountryLanguageRepository")
  6.  *
  7.  * @ORM\Table(
  8.  *          name="ps_country_lang",
  9.  *              uniqueConstraints={
  10.  *
  11.  *                  @ORM\UniqueConstraint(name="uk_country_language", columns={"id_country", "id_lang"})
  12.  *              }
  13.  *        )
  14.  */
  15. class CountryLanguage
  16. {
  17.     /**
  18.      * @var int
  19.      *
  20.      * @ORM\GeneratedValue()
  21.      *
  22.      * @ORM\Column(type="integer")
  23.      *
  24.      * @ORM\Id
  25.      */
  26.     protected $id;
  27.     /**
  28.      * @var Country
  29.      *
  30.      * @ORM\ManyToOne(targetEntity="App\Entity\System\Country", inversedBy="countryLanguages")
  31.      *
  32.      * @ORM\JoinColumn(name="id_country", referencedColumnName="id_country", nullable=false)
  33.      */
  34.     private $country;
  35.     /**
  36.      * @var Language
  37.      *
  38.      * @ORM\ManyToOne(targetEntity="App\Entity\System\Language", inversedBy="countryLanguages")
  39.      *
  40.      * @ORM\JoinColumn(name="id_lang", referencedColumnName="id_lang", nullable=false)
  41.      */
  42.     private $language;
  43.     /**
  44.      * @var string
  45.      *
  46.      * @ORM\Column(type="string", length=64)
  47.      */
  48.     private $name;
  49.     /**
  50.      * @return Country
  51.      */
  52.     public function getCountry(): Country
  53.     {
  54.         return $this->country;
  55.     }
  56.     /**
  57.      * @param Country $country
  58.      *
  59.      * @return CountryLanguage
  60.      */
  61.     public function setCountry(Country $country): CountryLanguage
  62.     {
  63.         $this->country $country;
  64.         return $this;
  65.     }
  66.     /**
  67.      * @return Language
  68.      */
  69.     public function getLanguage(): Language
  70.     {
  71.         return $this->language;
  72.     }
  73.     /**
  74.      * @param Language $language
  75.      *
  76.      * @return CountryLanguage
  77.      */
  78.     public function setLanguage(Language $language): CountryLanguage
  79.     {
  80.         $this->language $language;
  81.         return $this;
  82.     }
  83.     /**
  84.      * @return string
  85.      */
  86.     public function getName(): string
  87.     {
  88.         return $this->name;
  89.     }
  90.     /**
  91.      * @param string $name
  92.      *
  93.      * @return CountryLanguage
  94.      */
  95.     public function setName(string $name): CountryLanguage
  96.     {
  97.         $this->name $name;
  98.         return $this;
  99.     }
  100. }