mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-02-01 22:47:36 +00:00
31 lines
451 B
PHP
31 lines
451 B
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
class Reservation
|
|
{
|
|
private $tickets;
|
|
|
|
public function __construct($tickets)
|
|
{
|
|
$this->tickets = $tickets;
|
|
}
|
|
|
|
public function totalCost()
|
|
{
|
|
return $this->tickets->sum('price');
|
|
}
|
|
|
|
public function tickets()
|
|
{
|
|
return $this->tickets;
|
|
}
|
|
|
|
public function cancel()
|
|
{
|
|
foreach ($this->tickets as $ticket) {
|
|
$ticket->release();
|
|
}
|
|
}
|
|
}
|