Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Costumer{
- private $firstname;
- private $lastname;
- Private $seat;
- /**
- * @return mixed
- */
- public function getFirstname()
- {
- return $this->firstname;
- }
- /**
- * @param mixed $firstname
- */
- public function setFirstname($firstname)
- {
- $this->firstname = $firstname;
- }
- /**
- * @return mixed
- */
- public function getLastname()
- {
- return $this->lastname;
- }
- /**
- * @param mixed $lastname
- */
- public function setLastname($lastname)
- {
- $this->lastname = $lastname;
- }
- /**
- * @return mixed
- */
- public function getSeat()
- {
- return $this->seat;
- }
- /**
- * @param $seat
- */
- private function setSeat($seat)
- {
- $this->seat = $seat;
- }
- public function book(){
- $randomseat = random_int(1, 100);
- //query
- $this->setSeat($randomseat);
- }
- public function printTicket(){
- $ticket ="<h2>Ticket</h2>";
- $ticket.="Passenger:" . $this->getFirstname() . $this->getLastname();
- $ticket.="<br />Seat:" . $this->getSeat();
- return $ticket;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement