Conditions | 5 |
Paths | 4 |
Total Lines | 26 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
23 | public function php($data) |
||
24 | { |
||
25 | $valid = parent::php($data); |
||
26 | //do component validation |
||
27 | try { |
||
28 | $this->config->validateData($data); |
||
29 | } catch (ValidationException $e) { |
||
30 | $result = $e->getResult(); |
||
31 | foreach ($result->getMessages() as $message) { |
||
32 | if (!$this->fieldHasError($message['fieldName'])) { |
||
33 | $this->validationError($message['fieldName'], $message['message'], 'bad'); |
||
34 | } |
||
35 | } |
||
36 | $valid = false; |
||
37 | } |
||
38 | if (!$valid) { |
||
39 | $this->form->sessionMessage( |
||
40 | _t( |
||
41 | __CLASS__ . ".InvalidDataMessage", |
||
42 | "There are problems with the data you entered. See below:" |
||
43 | ), |
||
44 | "bad" |
||
45 | ); |
||
46 | } |
||
47 | |||
48 | return $valid; |
||
49 | } |
||
63 |