Advertisement
Guest User

Untitled

a guest
Mar 20th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. <?php
  2. class Costumer{
  3. private $firstname;
  4. private $lastname;
  5. Private $seat;
  6.  
  7. /**
  8. * @return mixed
  9. */
  10. public function getFirstname()
  11. {
  12. return $this->firstname;
  13. }
  14.  
  15. /**
  16. * @param mixed $firstname
  17. */
  18. public function setFirstname($firstname)
  19. {
  20. $this->firstname = $firstname;
  21. }
  22.  
  23. /**
  24. * @return mixed
  25. */
  26. public function getLastname()
  27. {
  28. return $this->lastname;
  29. }
  30.  
  31. /**
  32. * @param mixed $lastname
  33. */
  34. public function setLastname($lastname)
  35. {
  36. $this->lastname = $lastname;
  37. }
  38.  
  39. /**
  40. * @return mixed
  41. */
  42. public function getSeat()
  43. {
  44. return $this->seat;
  45. }
  46.  
  47. /**
  48. * @param $seat
  49. */
  50. private function setSeat($seat)
  51. {
  52. $this->seat = $seat;
  53. }
  54.  
  55. public function book(){
  56. $randomseat = random_int(1, 100);
  57. //query
  58. $this->setSeat($randomseat);
  59. }
  60. public function printTicket(){
  61. $ticket ="<h2>Ticket</h2>";
  62. $ticket.="Passenger:" . $this->getFirstname() . $this->getLastname();
  63. $ticket.="<br />Seat:" . $this->getSeat();
  64. return $ticket;
  65. }
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement