1: <?php
2:
3: namespace Charcoal\Ui\FormGroup;
4:
5:
6: use \Charcoal\Ui\AbstractUiItem;
7: use \Charcoal\Ui\FormGroup\FormGroupInterface;
8: use \Charcoal\Ui\FormGroup\FormGroupTrait;
9: use \Charcoal\Ui\Layout\LayoutAwareInterface;
10: use \Charcoal\Ui\Layout\LayoutAwareTrait;
11:
12: 13: 14: 15: 16:
17: abstract class AbstractFormGroup extends AbstractUiItem implements
18: FormGroupInterface,
19: LayoutAwareInterface
20: {
21: use FormGroupTrait;
22: use LayoutAwareTrait;
23:
24: 25: 26: 27: 28:
29: public function __construct($data)
30: {
31: parent::__construct($data);
32:
33: if (isset($data['form'])) {
34: $this->setForm($data['form']);
35: }
36:
37:
38: $this->setFormInputBuilder($data['form_input_builder']);
39:
40:
41: $this->setLayoutBuilder($data['layout_builder']);
42: }
43:
44: 45: 46: 47:
48: public function setData(array $data)
49: {
50: if (isset($data['permissions'])) {
51: $this->setRequiredAclPermissions($data['permissions']);
52: unset($data['permissions']);
53: }
54:
55: parent::setData($data);
56:
57: return $this;
58: }
59: }
60: