Source of file FamilyDiscount.php
Size: 0,561 Bytes - Last Modified: 2021-12-23T10:11:33+00:00
/var/www/docs.ssmods.com/process/src/code/calculator/FamilyDiscount.php
12345678910111213141516171819202122232425 | <?php namespace EventRegistration\Calculator; class FamilyDiscount extends Discount { public $name = "Family"; // at least one parent and one child ticket public function registrationQualifies(\EventRegistration $reg) { $hasparent = false; $haschild = false; $attendees = parent::getDiscountableAttendees($reg); foreach ($attendees as $attendee) { $hasparent = $hasparent || !$attendee->Ticket()->Child; $haschild = $haschild || $attendee->Ticket()->Child; if ($hasparent && $haschild) { return true; } } return false; } } |