1: <?php
2:
3: namespace Charcoal\Ui\FormInput;
4:
5: // Intra-module (`charcoal-ui`) dependencies
6: use \Charcoal\Ui\AbstractUiItem;
7: use \Charcoal\Ui\FormGroup\FormGroupInterface;
8:
9: /**
10: * A Basic Form Input
11: *
12: * Abstract implementation of {@see \Charcoal\Ui\FormInput\FormInputInterface}.
13: */
14: abstract class AbstractFormInput extends AbstractUiItem implements
15: FormInputInterface
16: {
17: /**
18: * The form group the input belongs to.
19: *
20: * @var FormGroupInterface
21: */
22: protected $formGroup;
23:
24: /**
25: * Set the form input's parent group.
26: *
27: * @param FormGroupInterface $formGroup The parent form group object.
28: * @return FormInputInterface Chainable
29: */
30: public function setFormGroup(FormGroupInterface $formGroup)
31: {
32: $this->formGroup = $formGroup;
33:
34: return $this;
35: }
36:
37: /**
38: * Retrieve the input's parent group.
39: *
40: * @return FormGroupInterface
41: */
42: public function formGroup()
43: {
44: return $this->formGroup;
45: }
46: }
47: