mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-02-04 14:48:42 +00:00
6.1 - Uncovering a New Domain Object
This commit is contained in:
18
app/Reservation.php
Normal file
18
app/Reservation.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
class Reservation
|
||||
{
|
||||
private $tickets;
|
||||
|
||||
public function __construct($tickets)
|
||||
{
|
||||
$this->tickets = $tickets;
|
||||
}
|
||||
|
||||
public function totalCost()
|
||||
{
|
||||
return $this->tickets->sum('price');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user