src/CoreBundle/Entity/AutoRiaOptions.php line 10

Open in your IDE?
  1. <?php
  2. namespace CoreBundle\Entity;
  3. use Doctrine\Common\Collections\Collection;
  4. /**
  5.  * AutoRiaOptions
  6.  */
  7. class AutoRiaOptions
  8. {
  9.     /**
  10.      * @var int
  11.      */
  12.     private $id;
  13.     /**
  14.      * @var int
  15.      */
  16.     private $autoria_id;
  17.     /**
  18.      * @var string
  19.      */
  20.     private $title_ru;
  21.     /**
  22.      * @var string
  23.      */
  24.     private $title_ua;
  25.     /**
  26.      * @var Collection
  27.      */
  28.     private $vehicles;
  29.     /**
  30.      * @var Collection
  31.      */
  32.     protected $vehicle_auto_ria_options;
  33.     /**
  34.      * Get id.
  35.      *
  36.      * @return int
  37.      */
  38.     public function getId()
  39.     {
  40.         return $this->id;
  41.     }
  42.     /**
  43.      * Set autoriaId
  44.      *
  45.      * @param string $autoriaId
  46.      *
  47.      */
  48.     public function setAutoriaId($autoriaId)
  49.     {
  50.         $this->autoria_id $autoriaId;
  51.         return $this;
  52.     }
  53.     /**
  54.      * Get autoriaId
  55.      *
  56.      * @return string
  57.      */
  58.     public function getAutoriaId()
  59.     {
  60.         return $this->autoria_id;
  61.     }
  62.     /**
  63.      * Set titleRu
  64.      *
  65.      * @param string $titleRu
  66.      *
  67.      */
  68.     public function setTitleRu($titleRu)
  69.     {
  70.         $this->title_ru $titleRu;
  71.         return $this;
  72.     }
  73.     /**
  74.      * Get titleRu
  75.      *
  76.      * @return string
  77.      */
  78.     public function getTitleRu()
  79.     {
  80.         return $this->title_ru;
  81.     }
  82.     /**
  83.      * Set titleUa
  84.      *
  85.      * @param string $titleUa
  86.      *
  87.      */
  88.     public function setTitleUa($titleUa)
  89.     {
  90.         $this->title_ua $titleUa;
  91.         return $this;
  92.     }
  93.     /**
  94.      * Get titleUa
  95.      *
  96.      * @return string
  97.      */
  98.     public function getTitleUa()
  99.     {
  100.         return $this->title_ua;
  101.     }
  102.     /**
  103.      * Get vehicles.
  104.      *
  105.      * @return Collection
  106.      */
  107.     public function getVehicles()
  108.     {
  109.         return $this->vehicles;
  110.     }
  111.     public function getTitle($locale)
  112.     {
  113.         if ($locale == 'ru' && $this->title_ru){
  114.             return $this->title_ru;
  115.         }
  116.         return $this->title_ua;
  117.     }
  118.     public function getVehicleAutoRiaOptions(): Collection
  119.     {
  120.         return $this->vehicle_auto_ria_options;
  121.     }
  122.     public function __toString(): string
  123.     {
  124.         return $this->getTitleUa();
  125.     }
  126. }