<?phpnamespace CoreBundle\Entity\Vehicles;use Application\Sonata\MediaBundle\Entity\Media;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;/** * RecommendGroup */class RecommendGroup{    /**     * @var integer     */    private $id;    /**     * @var string     */    private $title_ru;    /**     * @var string     */    private $title_ua;    /**     * @var integer     */    private $position;    /**     * @var string     */    private $url;    /**     * @var integer     */    private $state_slider = 1;    /**     * @var Media     */    private $image;    /**     * Get id     *     * @return integer     */    public function getId()    {        return $this->id;    }    /**     * Set titleRu     *     * @param string $titleRu     *     * @return RecomendGroup     */    public function setTitleRu($titleRu)    {        $this->title_ru = $titleRu;        return $this;    }    /**     * Get titleRu     *     * @return string     */    public function getTitleRu()    {        return $this->title_ru;    }    /**     * Set titleUa     *     * @param string $titleUa     *     * @return RecomendGroup     */    public function setTitleUa($titleUa)    {        $this->title_ua = $titleUa;        return $this;    }    /**     * Get titleUa     *     * @return string     */    public function getTitleUa()    {        return $this->title_ua;    }    public function getTitle($locale = 'ua')    {        return $locale == 'ru' ? $this->title_ru : $this->title_ua;    }    /**     * Set position     *     * @param integer $position     *     * @return RecomendGroup     */    public function setPosition($position)    {        $this->position = $position;        return $this;    }    /**     * Get position     *     * @return integer     */    public function getPosition()    {        return $this->position;    }    /**     * Set url     *     * @param string $url     *     * @return RecomendGroup     */    public function setUrl($url)    {        $this->url = $url;        return $this;    }    /**     * Get url     *     * @return string     */    public function getUrl()    {        return $this->url;    }    /**     * Set image     *     * @param Media $image     *     * @return RecomendGroup     */    public function setImage(Media $image = null)    {        $this->image = $image;        return $this;    }    /**     * Get image     *     * @return Media     */    public function getImage()    {        return $this->image;    }    public function __toString()    {        return (string) $this->title_ru;    }    /**     * @var Collection     */    private $vehicles;    /**     * Constructor     */    public function __construct()    {        $this->vehicles = new ArrayCollection();    }    /**     * Add vehicle     *     * @param Vehicle $vehicle     *     * @return RecommendGroup     */    public function addVehicle(Vehicle $vehicle)    {        $this->vehicles[] = $vehicle;        return $this;    }    /**     * Remove vehicle     *     * @param Vehicle $vehicle     */    public function removeVehicle(Vehicle $vehicle)    {        $this->vehicles->removeElement($vehicle);    }    /**     * Get vehicles     *     * @return Collection     */    public function getVehicles()    {        return $this->vehicles;    }    /**     * @var integer     */    private $state = 1;    /**     * Set state     *     * @param integer $state     *     * @return RecommendGroup     */    public function setState($state)    {        $this->state = $state;        return $this;    }    /**     * Get state     *     * @return integer     */    public function getState()    {        return (boolean)$this->state;    }    /**     * Set stateSlider     *     * @param integer $stateSlider     *     * @return RecommendGroup     */    public function setStateSlider($stateSlider)    {        $this->state_slider = $stateSlider;        return $this;    }    /**     * Get stateSlider     *     * @return integer     */    public function getStateSlider()    {        return (boolean)$this->state_slider;    }}