add admin panel
Co-authored-by: Jan-Marlon Leibl <jleibl@proton.me> Reviewed-on: #20
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Enum\TicketData;
|
||||
use App\Repository\PaymentRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
@ -63,4 +64,11 @@ class Payment
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTotal(): float
|
||||
{
|
||||
return $this->customer->getTickets()->reduce(function (float $total, Ticket $ticket) {
|
||||
return $total + TicketData::TICKET_DATA[$ticket->getType()]['price'];
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user