name; } /** * @param string $name */ public function setName($name) { $this->name = $name; } /** * @return string */ public function getDescription() { return $this->description; } /** * @param string $description */ public function setDescription($description) { $this->description = $description; } /** * @return int */ public function getNumber() { return $this->number; } /** * @param int $number */ public function setNumber($number) { $this->number = $number; } /** * @return SummitVenue */ public function getVenue() { return $this->venue; } /** * @return int */ public function getVenueId(){ try{ return $this->venue->getId(); } catch(\Exception $ex){ return 0; } } /** * @return File */ public function getImage() { return $this->image; } /** * @return SummitVenueRoom[] */ public function getRooms(){ return $this->rooms; } /** * @param int $room_id * @return SummitVenueRoom */ public function getRoom($room_id){ $criteria = Criteria::create(); $criteria->where(Criteria::expr()->eq('id', intval($room_id))); $room = $this->rooms->matching($criteria)->first(); return $room === false ? null : $room; } public function __construct() { parent::__construct(); $this->rooms = new ArrayCollection; } /** * @param SummitVenue|null $venue */ public function setVenue($venue) { $this->venue = $venue; } public function clearVenue(){ $this->venue = null; } /** * @param File $image */ public function setImage($image) { $this->image = $image; } /** * @param SummitVenueRoom $room */ public function addRoom(SummitVenueRoom $room){ $this->rooms->add($room); $room->setFloor($this); } /** * @param SummitVenueRoom $room */ public function removeRoom(SummitVenueRoom $room){ $this->rooms->removeElement($room); $room->clearFloor(); } use OrderableChilds; /** * @param SummitVenueRoom $room * @param int $new_order * @throws ValidationException */ public function recalculateRoomsOrder(SummitVenueRoom $room, $new_order){ self::recalculateOrderFor($this->rooms, $room, $new_order); } }