| Conditions | 3 |
| Paths | 4 |
| Total Lines | 23 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | public function __construct($settings, $defaultData = []) |
||
| 15 | { |
||
| 16 | parent::__construct($settings); |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Set form data |
||
| 20 | */ |
||
| 21 | foreach ($this->setting('meta', []) as $field => $title) { |
||
| 22 | $this->setData( |
||
| 23 | $field, |
||
| 24 | $this->request()->data( // from POST |
||
| 25 | $field, |
||
| 26 | \WebServCo\Framework\Utils::isA($defaultData, $field) // default data |
||
| 27 | ) |
||
| 28 | ); |
||
| 29 | } |
||
| 30 | |||
| 31 | $this->errors = []; |
||
| 32 | |||
| 33 | $this->filtered = $this->filter(); |
||
| 34 | |||
| 35 | if ($this->isSent()) { |
||
| 36 | $this->valid = $this->validate(); |
||
| 37 | } |
||
| 71 |