1 | <?php namespace Anomaly\Streams\Platform\Ui\Form\Multiple; |
||
24 | class MultipleFormBuilder extends FormBuilder |
||
25 | { |
||
26 | |||
27 | /** |
||
28 | * The form collection. |
||
29 | * |
||
30 | * @var FormCollection |
||
31 | */ |
||
32 | protected $forms; |
||
33 | |||
34 | /** |
||
35 | * Create a new MultipleFormBuilder instance. |
||
36 | * |
||
37 | * @param Form $form |
||
38 | * @param FormCollection $forms |
||
39 | */ |
||
40 | public function __construct(Form $form, FormCollection $forms) |
||
46 | |||
47 | /** |
||
48 | * Build the form. |
||
49 | * |
||
50 | * @param null $entry |
||
51 | */ |
||
52 | public function build($entry = null) |
||
61 | |||
62 | /** |
||
63 | * Save the forms. |
||
64 | */ |
||
65 | public function saveForm() |
||
81 | |||
82 | /** |
||
83 | * Get the forms. |
||
84 | * |
||
85 | * @return FormCollection |
||
86 | */ |
||
87 | public function getForms() |
||
91 | |||
92 | /** |
||
93 | * Set the forms. |
||
94 | * |
||
95 | * @param $forms |
||
96 | * @return $this |
||
97 | */ |
||
98 | public function setForms(FormCollection $forms) |
||
104 | |||
105 | /** |
||
106 | * Add a form. |
||
107 | * |
||
108 | * @param $key |
||
109 | * @param FormBuilder $builder |
||
110 | * @return MultipleFormBuilder |
||
111 | */ |
||
112 | public function addForm($key, FormBuilder $builder) |
||
123 | |||
124 | /** |
||
125 | * Get a child form. |
||
126 | * |
||
127 | * @param $key |
||
128 | * @return FormBuilder |
||
129 | */ |
||
130 | public function getChildForm($key) |
||
134 | |||
135 | /** |
||
136 | * Get the stream of a child form. |
||
137 | * |
||
138 | * @param $key |
||
139 | * @return StreamInterface|null |
||
140 | */ |
||
141 | public function getChildFormStream($key) |
||
147 | |||
148 | /** |
||
149 | * Get the entry of a child form. |
||
150 | * |
||
151 | * @param $key |
||
152 | * @return EloquentModel|EntryInterface|FieldInterface|AssignmentInterface|null |
||
153 | */ |
||
154 | public function getChildFormEntry($key) |
||
160 | |||
161 | /** |
||
162 | * Get the entry ID of a child form. |
||
163 | * |
||
164 | * @param $key |
||
165 | * @return int|null |
||
166 | */ |
||
167 | public function getChildFormEntryId($key) |
||
173 | |||
174 | /** |
||
175 | * Get a child's entry. |
||
176 | * |
||
177 | * @param $key |
||
178 | * @return mixed |
||
179 | */ |
||
180 | public function getChildEntry($key) |
||
186 | |||
187 | /** |
||
188 | * Get the form mode. |
||
189 | * |
||
190 | * @return null|string |
||
191 | */ |
||
192 | public function getFormMode() |
||
198 | |||
199 | /** |
||
200 | * Get the contextual entry ID. |
||
201 | * |
||
202 | * @return int|mixed|null |
||
203 | */ |
||
204 | public function getContextualId() |
||
211 | } |
||
212 |