singleSeat = $ssu->singleSeat()->first(); else $this->singleSeat = $ssu; } public function calcSeatName(){ if($this->singleSeat->seat->event->reservation->name === "Mit Tischwahl"){ //return "Tisch ".$this->singleSeat->x.", Platz ".$this->singleSeat->y; return "Reihe ".(14-$this->singleSeat->x).", Platz ".$this->singleSeat->y; } if($this->hasSeatNumbering()){ return $this->getTextWithSeatNumbering(); }else{ return $this->getTextWithoutSeatNumbering(); } } private function isEventWithoutSeatNumbering() { $reservationName = $this->singleSeat->seat()->first()->event()->first()->reservation()->first()->name; return $reservationName == "Ohne Platzwahl"; } private function isEventSilvesterSpecial(){ return $this->singleSeat->x === 0 && $this->singleSeat->y === 0; } private function hasSeatNumbering() { if($this->isEventWithoutSeatNumbering()){ return false; } if($this->isEventSilvesterSpecial()){ return false; } return true; } private function getTextWithoutSeatNumbering() { if($this->isEventSilvesterSpecial()) return "Erdgeschoss / Tisch"; if($this->isEventWithoutSeatNumbering()) return "Freie Platzwahl"; } private function getTextWithSeatNumbering() { $simpleSeatPlace = new FormatSeatWithNumbering($this->singleSeat->x, $this->singleSeat->y); return $simpleSeatPlace->getText(); } }