| Conditions | 2 |
| Paths | 2 |
| Total Lines | 28 |
| Code Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public function __construct($tickets) |
||
| 19 | { |
||
| 20 | parent::__construct('delegate-form'); |
||
| 21 | $this->add(['type' => Hidden::class, 'name' => 'stripe_token']); |
||
| 22 | $this->add([ |
||
| 23 | 'type' => Text::class, |
||
| 24 | 'name' => 'purchase_email', |
||
| 25 | 'options' => [ |
||
| 26 | 'label' => 'Email', |
||
| 27 | 'help-block' => 'Your receipt will be emailed to this address' |
||
| 28 | ] |
||
| 29 | ]); |
||
| 30 | |||
| 31 | for ($i = 0; $i < $tickets; $i++) { |
||
| 32 | $this->add(['type' => DelegateInformation::class, 'name' => 'delegates_' . $i]); |
||
| 33 | } |
||
| 34 | |||
| 35 | $this->add(new Csrf('security')); |
||
| 36 | |||
| 37 | $this->getInputFilter() |
||
| 38 | ->get('purchase_email') |
||
| 39 | ->setAllowEmpty(false) |
||
| 40 | ->setRequired(true) |
||
| 41 | ->getValidatorChain() |
||
| 42 | ->attach(new NotEmpty()) |
||
| 43 | ->attach(new EmailAddress()); |
||
| 44 | |||
| 45 | } |
||
| 46 | } |