<?phpnamespace CoreBundle\Entity\Vehicles;use Application\Sonata\MediaBundle\Entity\Media;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;/** * Category */class Category{ /** * @var integer */ private $id; /** * @var integer */ private $temp_id; /** * @var string */ private $title_ru; /** * @var string */ private $title_ua; /** * @var integer */ private $position; /** * @var string */ private $url; /** * @var Media */ private $image; /** * Get id * * @return integer */ public function getId() { return $this->id; } /** * Set tempId * * @param integer $tempId * * @return Category */ public function setTempId($tempId) { $this->temp_id = $tempId; return $this; } /** * Get tempId * * @return integer */ public function getTempId() { return $this->temp_id; } /** * Set titleRu * * @param string $titleRu * * @return Category */ public function setTitleRu($titleRu) { $this->title_ru = $titleRu; return $this; } /** * Get titleRu * * @return string */ public function getTitleRu() { return $this->title_ru; } public function getTitle($locale) { return $locale == 'ru' ? $this->getTitleRu() : $this->getTitleUa(); } /** * Set titleUa * * @param string $titleUa * * @return Category */ public function setTitleUa($titleUa) { $this->title_ua = $titleUa; return $this; } /** * Get titleUa * * @return string */ public function getTitleUa() { return $this->title_ua; } /** * Set position * * @param integer $position * * @return Category */ 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 Category */ 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 Category */ 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->getTitleRu(); } /** * @var integer */ private $vehicle_type; /** * Set vehicleType * * @param integer $vehicleType * * @return Category */ public function setVehicleType($vehicleType) { $this->vehicle_type = $vehicleType; return $this; } /** * Get vehicleType * * @return integer */ public function getVehicleType() { return $this->vehicle_type; } /** * @var Collection */ private $vehicles; /** * Constructor */ public function __construct() { $this->vehicles = new ArrayCollection(); } /** * Add vehicle. * * @param Vehicle $vehicle * * @return Category */ public function addVehicle(Vehicle $vehicle) { $this->vehicles[] = $vehicle; return $this; } /** * Remove vehicle. * * @param Vehicle $vehicle * * @return boolean TRUE if this collection contained the specified element, FALSE otherwise. */ public function removeVehicle(Vehicle $vehicle) { return $this->vehicles->removeElement($vehicle); } /** * Get vehicles. * * @return Collection */ public function getVehicles() { return $this->vehicles; } /** * @var string|null */ private $description; /** * Set description. * * @param string|null $description * * @return Category */ public function setDescription($description = null) { $this->description = $description; return $this; } /** * Get description. * * @return string|null */ public function getDescriptionByLocale($locale): ?string { if($locale == 'ru') { return $this->getDescriptionRu(); } return $this->getDescriptionUa(); } /** * @var string|null */ private $description_ua; /** * @var string|null */ private $description_ru; /** * Set descriptionUa. * * @param string|null $descriptionUa * * @return Category */ public function setDescriptionUa($descriptionUa = null) { $this->description_ua = $descriptionUa; return $this; } /** * Get descriptionUa. * * @return string|null */ public function getDescriptionUa() { return $this->description_ua; } /** * Set descriptionRu. * * @param string|null $descriptionRu * * @return Category */ public function setDescriptionRu($descriptionRu = null) { $this->description_ru = $descriptionRu; return $this; } /** * Get descriptionRu. * * @return string|null */ public function getDescriptionRu() { return $this->description_ru; }}