src/CoreBundle/Entity/Vehicles/Group.php line 13

Open in your IDE?
  1. <?php
  2. namespace CoreBundle\Entity\Vehicles;
  3. use Application\Sonata\MediaBundle\Entity\Media;
  4. use CoreBundle\Entity\Dealer;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. /**
  8.  * Group
  9.  */
  10. class Group
  11. {
  12.     /**
  13.      * @var integer
  14.      */
  15.     private $id;
  16.     /**
  17.      * @var integer
  18.      */
  19.     private $temp_id;
  20.     /**
  21.      * @var string
  22.      */
  23.     private $title_ru;
  24.     /**
  25.      * @var string
  26.      */
  27.     private $title_ua;
  28.     /**
  29.      * @var string
  30.      */
  31.     private $inner_name;
  32.     /**
  33.      * @var Media
  34.      */
  35.     private $preview;
  36.     /**
  37.      * @var Dealer
  38.      */
  39.     private $dealer;
  40.     /**
  41.      * @var integer
  42.      */
  43.     private $vehicle_type;
  44.     /**
  45.      * Get id
  46.      *
  47.      * @return integer
  48.      */
  49.     public function getId()
  50.     {
  51.         return $this->id;
  52.     }
  53.     /**
  54.      * Set tempId
  55.      *
  56.      * @param integer $tempId
  57.      *
  58.      * @return Group
  59.      */
  60.     public function setTempId($tempId)
  61.     {
  62.         $this->temp_id $tempId;
  63.         return $this;
  64.     }
  65.     /**
  66.      * Get tempId
  67.      *
  68.      * @return integer
  69.      */
  70.     public function getTempId()
  71.     {
  72.         return $this->temp_id;
  73.     }
  74.     /**
  75.      * Set titleRu
  76.      *
  77.      * @param string $titleRu
  78.      *
  79.      * @return Group
  80.      */
  81.     public function setTitleRu($titleRu)
  82.     {
  83.         $this->title_ru $titleRu;
  84.         return $this;
  85.     }
  86.     /**
  87.      * Get titleRu
  88.      *
  89.      * @return string
  90.      */
  91.     public function getTitleRu()
  92.     {
  93.         return $this->title_ru;
  94.     }
  95.     /**
  96.      * Set titleUa
  97.      *
  98.      * @param string $titleUa
  99.      *
  100.      * @return Group
  101.      */
  102.     public function setTitleUa($titleUa)
  103.     {
  104.         $this->title_ua $titleUa;
  105.         return $this;
  106.     }
  107.     /**
  108.      * Get titleUa
  109.      *
  110.      * @return string
  111.      */
  112.     public function getTitleUa()
  113.     {
  114.         return $this->title_ua;
  115.     }
  116.     public function getTitleByLocale$locale )
  117.     {
  118.         return $locale == 'ru' $this->getTitleRu() : $this->getTitleUa();
  119.     }
  120.     public function getTitle($locale)
  121.     {
  122.         return $locale == 'ru' $this->getTitleRu() : $this->getTitleUa();
  123.     }
  124.     /**
  125.      * Set innerName
  126.      *
  127.      * @param string $innerName
  128.      *
  129.      * @return Group
  130.      */
  131.     public function setInnerName($innerName)
  132.     {
  133.         $this->inner_name $innerName;
  134.         return $this;
  135.     }
  136.     /**
  137.      * Get innerName
  138.      *
  139.      * @return string
  140.      */
  141.     public function getInnerName()
  142.     {
  143.         return $this->inner_name;
  144.     }
  145.     /**
  146.      * Set preview
  147.      *
  148.      * @param Media $preview
  149.      *
  150.      * @return Group
  151.      */
  152.     public function setPreview(Media $preview null)
  153.     {
  154.         $this->preview $preview;
  155.         return $this;
  156.     }
  157.     /**
  158.      * Get preview
  159.      *
  160.      * @return Media
  161.      */
  162.     public function getPreview()
  163.     {
  164.         return $this->preview;
  165.     }
  166.     /**
  167.      * Set dealer
  168.      *
  169.      * @param Dealer $dealer
  170.      *
  171.      * @return Group
  172.      */
  173.     public function setDealer(Dealer $dealer null)
  174.     {
  175.         $this->dealer $dealer;
  176.         return $this;
  177.     }
  178.     /**
  179.      * Get dealer
  180.      *
  181.      * @return Dealer
  182.      */
  183.     public function getDealer()
  184.     {
  185.         return $this->dealer;
  186.     }
  187.     /**
  188.      * Set vehicleType
  189.      *
  190.      * @param integer $vehicleType
  191.      *
  192.      * @return Group
  193.      */
  194.     public function setVehicleType($vehicleType)
  195.     {
  196.         $this->vehicle_type $vehicleType;
  197.         return $this;
  198.     }
  199.     /**
  200.      * Get vehicleType
  201.      *
  202.      * @return integer
  203.      */
  204.     public function getVehicleType()
  205.     {
  206.         return $this->vehicle_type;
  207.     }
  208.     public function __toString()
  209.     {
  210.         return (string) $this->getTitleRu();
  211.     }
  212.     /**
  213.      * @var integer
  214.      */
  215.     private $position;
  216.     /**
  217.      * Set position
  218.      *
  219.      * @param integer $position
  220.      *
  221.      * @return Group
  222.      */
  223.     public function setPosition($position)
  224.     {
  225.         $this->position $position;
  226.         return $this;
  227.     }
  228.     /**
  229.      * Get position
  230.      *
  231.      * @return integer
  232.      */
  233.     public function getPosition()
  234.     {
  235.         return $this->position;
  236.     }
  237.     /**
  238.      * @var string
  239.      */
  240.     private $url;
  241.     /**
  242.      * Set url
  243.      *
  244.      * @param string $url
  245.      *
  246.      * @return Group
  247.      */
  248.     public function setUrl($url)
  249.     {
  250.         $this->url $url;
  251.         return $this;
  252.     }
  253.     /**
  254.      * Get url
  255.      *
  256.      * @return string
  257.      */
  258.     public function getUrl()
  259.     {
  260.         return $this->url;
  261.     }
  262.     /**
  263.      * @var Collection
  264.      */
  265.     private $vehicle;
  266.     /**
  267.      * Constructor
  268.      */
  269.     public function __construct()
  270.     {
  271.         $this->vehicle = new ArrayCollection();
  272.     }
  273.     /**
  274.      * Add vehicle
  275.      *
  276.      * @param Vehicle $vehicle
  277.      *
  278.      * @return Group
  279.      */
  280.     public function addVehicle(Vehicle $vehicle)
  281.     {
  282.         $this->vehicle[] = $vehicle;
  283.         return $this;
  284.     }
  285.     /**
  286.      * Remove vehicle
  287.      *
  288.      * @param Vehicle $vehicle
  289.      */
  290.     public function removeVehicle(Vehicle $vehicle)
  291.     {
  292.         $this->vehicle->removeElement($vehicle);
  293.     }
  294.     /**
  295.      * Get vehicle
  296.      *
  297.      * @return Collection
  298.      */
  299.     public function getVehicle()
  300.     {
  301.         return $this->vehicle;
  302.     }
  303.     /**
  304.      * @var Collection
  305.      */
  306.     private $vehicles;
  307.     /**
  308.      * Get vehicles
  309.      *
  310.      * @return Collection
  311.      */
  312.     public function getVehicles()
  313.     {
  314.         return $this->vehicles;
  315.     }
  316. }