vendor/nexcrm/nexcrm-base-bundle/src/Entity/Lang.php line 17

Open in your IDE?
  1. <?php
  2. namespace NexCRM\BaseBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Knp\DoctrineBehaviors\Contract\Entity\TranslatableInterface;
  5. use Knp\DoctrineBehaviors\Model\Translatable\TranslatableTrait;
  6. use NexCRM\BaseBundle\Entity\Country;
  7. use NexCRM\BaseBundle\Entity\EntityTrait\IdentifiableTrait;
  8. /**
  9.  * Lang
  10.  *
  11.  * @ORM\Table(name="lang",indexes={@ORM\Index(name="active", columns={"active"})})
  12.  * @ORM\Entity(repositoryClass="NexCRM\BaseBundle\Repository\LangRepository")
  13.  */
  14. class Lang
  15. {
  16.     use IdentifiableTrait;
  17.     /**
  18.      * @var string
  19.      *
  20.      * @ORM\Column(name="name", type="string", length=255)
  21.      */
  22.     private $name;
  23.     /**
  24.      * @var string
  25.      *
  26.      * @ORM\Column(name="iso_2", type="string", length=2)
  27.      */
  28.     private $iso2;
  29.     /**
  30.      * @var string
  31.      *
  32.      * @ORM\Column(name="iso_3", type="string", length=3)
  33.      */
  34.     private $iso3;
  35.     /**
  36.      * @var boolean
  37.      *
  38.      * @ORM\Column(name="default_lang", type="boolean")
  39.      */
  40.     private $defaultLang false;
  41.     /**
  42.      * @var boolean
  43.      *
  44.      * @ORM\Column(name="active", type="boolean")
  45.      */
  46.     private $active;
  47.     /**
  48.      * @ORM\ManyToOne(targetEntity="Country")
  49.      * @ORM\JoinColumn(name="country", referencedColumnName="id")
  50.      */
  51.     private $country;
  52.     public function __construct()
  53.     {
  54.         $this->active true;
  55.     }
  56.     public function __toString()
  57.     {
  58.         return $this->name;
  59.     }
  60.     /**
  61.      * Get id
  62.      *
  63.      * @return int
  64.      */
  65.     public function getId()
  66.     {
  67.         return $this->id;
  68.     }
  69.     /**
  70.      * Set name
  71.      *
  72.      * @param string $name
  73.      *
  74.      * @return Lang
  75.      */
  76.     public function setName($name)
  77.     {
  78.         $this->name $name;
  79.         return $this;
  80.     }
  81.     /**
  82.      * Get name
  83.      *
  84.      * @return string
  85.      */
  86.     public function getName()
  87.     {
  88.         return $this->name;
  89.     }
  90.     /**
  91.      * Set iso2
  92.      *
  93.      * @param string $iso2
  94.      *
  95.      * @return Lang
  96.      */
  97.     public function setIso2($iso2)
  98.     {
  99.         $this->iso2 $iso2;
  100.         return $this;
  101.     }
  102.     /**
  103.      * Get iso2
  104.      *
  105.      * @return string
  106.      */
  107.     public function getIso2()
  108.     {
  109.         return $this->iso2;
  110.     }
  111.     /**
  112.      * Set iso3
  113.      *
  114.      * @param string $iso3
  115.      *
  116.      * @return Lang
  117.      */
  118.     public function setIso3($iso3)
  119.     {
  120.         $this->iso3 $iso3;
  121.         return $this;
  122.     }
  123.     /**
  124.      * Get iso3
  125.      *
  126.      * @return string
  127.      */
  128.     public function getIso3()
  129.     {
  130.         return $this->iso3;
  131.     }
  132.     /** @return bool */
  133.     public function isDefaultLang(): bool
  134.     {
  135.         return $this->defaultLang;
  136.     }
  137.     /** @param bool $defaultLang */
  138.     public function setDefaultLang(bool $defaultLang)
  139.     {
  140.         $this->defaultLang $defaultLang;
  141.     }
  142.     /** @return bool */
  143.     public function isActive(): bool
  144.     {
  145.         return $this->active;
  146.     }
  147.     /** @param bool $active */
  148.     public function setActive(bool $active)
  149.     {
  150.         $this->active $active;
  151.     }
  152.     /** @return mixed */
  153.     public function getCountry()
  154.     {
  155.         return $this->country;
  156.     }
  157.     /** @param mixed $country */
  158.     public function setCountry($country)
  159.     {
  160.         $this->country $country;
  161.     }
  162. }