mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-01-26 11:14:06 +00:00
38 lines
580 B
PHP
38 lines
580 B
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
class Reservation
|
|
{
|
|
private $tickets;
|
|
private $email;
|
|
|
|
public function __construct($tickets, $email)
|
|
{
|
|
$this->tickets = $tickets;
|
|
$this->email = $email;
|
|
}
|
|
|
|
public function totalCost()
|
|
{
|
|
return $this->tickets->sum('price');
|
|
}
|
|
|
|
public function tickets()
|
|
{
|
|
return $this->tickets;
|
|
}
|
|
|
|
public function email()
|
|
{
|
|
return $this->email;
|
|
}
|
|
|
|
public function cancel()
|
|
{
|
|
foreach ($this->tickets as $ticket) {
|
|
$ticket->release();
|
|
}
|
|
}
|
|
}
|