src/CoreBundle/Entity/Vehicles/Specification.php line 12

Open in your IDE?
  1. <?php
  2. namespace CoreBundle\Entity\Vehicles;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Application\Sonata\MediaBundle\Entity\Media;
  5. use Doctrine\Common\Collections\Collection;
  6. /**
  7.  * Specification
  8.  */
  9. class Specification
  10. {
  11.     /**
  12.      * @var integer
  13.      */
  14.     private $id;
  15.     /**
  16.      * @var integer
  17.      */
  18.     private $temp_id;
  19.     /**
  20.      * @var string
  21.      */
  22.     private $title_ru;
  23.     /**
  24.      * @var string
  25.      */
  26.     private $title_ua;
  27.     /**
  28.      * @var Vehicle
  29.      */
  30.     private $vehicle;
  31.     /**
  32.      * @var Media
  33.      */
  34.     private $image;
  35.     /**
  36.      * @var Collection
  37.      */
  38.     private $options;
  39.     /**
  40.      * Constructor
  41.      */
  42.     public function __construct()
  43.     {
  44.         $this->options = new ArrayCollection();
  45.     }
  46.     /**
  47.      * Get id
  48.      *
  49.      * @return integer
  50.      */
  51.     public function getId()
  52.     {
  53.         return $this->id;
  54.     }
  55.     /**
  56.      * Set tempId
  57.      *
  58.      * @param integer $tempId
  59.      *
  60.      * @return Specification
  61.      */
  62.     public function setTempId($tempId)
  63.     {
  64.         $this->temp_id $tempId;
  65.         return $this;
  66.     }
  67.     /**
  68.      * Get tempId
  69.      *
  70.      * @return integer
  71.      */
  72.     public function getTempId()
  73.     {
  74.         return $this->temp_id;
  75.     }
  76.     /**
  77.      * Set titleRu
  78.      *
  79.      * @param string $titleRu
  80.      *
  81.      * @return Specification
  82.      */
  83.     public function setTitleRu($titleRu)
  84.     {
  85.         $this->title_ru $titleRu;
  86.         return $this;
  87.     }
  88.     /**
  89.      * Get titleRu
  90.      *
  91.      * @return string
  92.      */
  93.     public function getTitleRu()
  94.     {
  95.         return $this->title_ru;
  96.     }
  97.     /**
  98.      * Set titleUa
  99.      *
  100.      * @param string $titleUa
  101.      *
  102.      * @return Specification
  103.      */
  104.     public function setTitleUa($titleUa)
  105.     {
  106.         $this->title_ua $titleUa;
  107.         return $this;
  108.     }
  109.     /**
  110.      * Get titleUa
  111.      *
  112.      * @return string
  113.      */
  114.     public function getTitleUa()
  115.     {
  116.         return $this->title_ua;
  117.     }
  118.     public function getTitle($locale)
  119.     {
  120.         return $locale == 'ru' $this->getTitleRu() : $this->getTitleUa();
  121.     }
  122.     /**
  123.      * Set vehicle
  124.      *
  125.      * @param Vehicle $vehicle
  126.      *
  127.      * @return Specification
  128.      */
  129.     public function setVehicle(Vehicle $vehicle null)
  130.     {
  131.         $this->vehicle $vehicle;
  132.         return $this;
  133.     }
  134.     /**
  135.      * Get vehicle
  136.      *
  137.      * @return Vehicle
  138.      */
  139.     public function getVehicle()
  140.     {
  141.         return $this->vehicle;
  142.     }
  143.     /**
  144.      * Set image
  145.      *
  146.      * @param Media $image
  147.      *
  148.      * @return Specification
  149.      */
  150.     public function setImage(Media $image null)
  151.     {
  152.         $this->image $image;
  153.         return $this;
  154.     }
  155.     /**
  156.      * Get image
  157.      *
  158.      * @return Media
  159.      */
  160.     public function getImage()
  161.     {
  162.         return $this->image;
  163.     }
  164.     /**
  165.      * Add option
  166.      *
  167.      * @param SpecificationOptions $option
  168.      *
  169.      * @return Specification
  170.      */
  171.     public function addOption(SpecificationOptions $option)
  172.     {
  173.         $this->options[] = $option;
  174.         return $this;
  175.     }
  176.     /**
  177.      * Remove option
  178.      *
  179.      * @param SpecificationOptions $option
  180.      */
  181.     public function removeOption(SpecificationOptions $option)
  182.     {
  183.         $this->options->removeElement($option);
  184.     }
  185.     /**
  186.      * Get options
  187.      *
  188.      * @return Collection
  189.      */
  190.     public function getOptions()
  191.     {
  192.         return $this->options;
  193.     }
  194.     public function __toString()
  195.     {
  196.         return (string) $this->getTitleRu();
  197.     }
  198. }