1: <?php
2:
3: namespace Charcoal\Ui\FormGroup;
4:
5: use \Charcoal\Ui\Form\FormInterface;
6:
7: /**
8: * Defines a form group.
9: */
10: interface FormGroupInterface
11: {
12: /**
13: * @param callable $cb The input callback.
14: * @return FormGroupInterface Chainable
15: */
16: public function setInputCallback(callable $cb);
17:
18: /**
19: * Set the form widget.
20: *
21: * @param FormInterface $form The related form widget.
22: * @return FormGroupInterface Chainable
23: */
24: public function setForm(FormInterface $form);
25:
26: /**
27: * Retrieve the form widget.
28: *
29: * @return FormInterface
30: */
31: public function form();
32:
33: /**
34: * @param string $mode The l10n mode.
35: * @return FormGroupInterface Chainable
36: */
37: public function setL10nMode($mode);
38:
39: /**
40: * @return string
41: */
42: public function l10nMode();
43:
44: /**
45: * @param array $inputs The group inputs structure.
46: * @return FormGroupInterface Chainable
47: */
48: public function setInputs(array $inputs);
49:
50: /**
51: * @param string $inputIdent The input identifier.
52: * @param array|FormInputInterface $input The input object or structure.
53: * @return FormInterface Chainable
54: */
55: public function addInput($inputIdent, $input);
56:
57: /**
58: * Form Input generator
59: *
60: * @param callable $inputCallback Optional. Input callback.
61: * @return FormGroupInterface[]
62: */
63: public function inputs(callable $inputCallback = null);
64:
65: /**
66: * @return boolean
67: */
68: public function hasInputs();
69:
70: /**
71: * @return integer
72: */
73: public function numInputs();
74:
75: /**
76: * Set the identifier of the group.
77: *
78: * @param string $ident Sidemenu group identifier.
79: * @return UiGroupingInterface Chainable
80: */
81: public function setIdent($ident);
82:
83: /**
84: * Retrieve the idenfitier of the group.
85: *
86: * @return string
87: */
88: public function ident();
89:
90: /**
91: * Activates/deactivates the group.
92: *
93: * @param boolean $active Activate (TRUE) or deactivate (FALSE) the group.
94: * @return UiItemInterface Chainable
95: */
96: public function setActive($active);
97:
98: /**
99: * Determine if the group is active.
100: *
101: * @return boolean
102: */
103: public function active();
104:
105: /**
106: * Set the group's priority or sorting index.
107: *
108: * @param integer $priority An index, for sorting.
109: * @return UiGroupingInterface Chainable
110: */
111: public function setPriority($priority);
112:
113: /**
114: * Retrieve the group's priority or sorting index.
115: *
116: * @return integer
117: */
118: public function priority();
119: }
120: