@@ 189-195 (lines=7) @@ | ||
186 | }, $keys)); |
|
187 | ||
188 | if ($field instanceof Field\Embeds) { |
|
189 | $newRules = array_map(function ($v) use ($availInput, $field) { |
|
190 | list($r, $k, $c) = explode('.', $v); |
|
191 | $v = "{$r}.{$k}"; |
|
192 | $embed = $field->getValidationRules([$field->column() => $availInput[$k][$c]]); |
|
193 | ||
194 | return $embed ? array_key_attach_str($embed, $v) : null; |
|
195 | }, $newColumn); |
|
196 | $rules = array_clean_merge($rules, array_filter($newRules)); |
|
197 | ||
198 | $newAttributes = array_map(function ($v) use ($availInput, $field) { |
|
@@ 198-204 (lines=7) @@ | ||
195 | }, $newColumn); |
|
196 | $rules = array_clean_merge($rules, array_filter($newRules)); |
|
197 | ||
198 | $newAttributes = array_map(function ($v) use ($availInput, $field) { |
|
199 | list($r, $k, $c) = explode('.', $v); |
|
200 | $v = "{$r}.{$k}"; |
|
201 | $embed = $field->getValidationAttributes([$field->column() => $availInput[$k][$c]]); |
|
202 | ||
203 | return $embed ? array_key_attach_str($embed, $v) : null; |
|
204 | }, $newColumn); |
|
205 | $attributes = array_clean_merge($attributes, array_filter($newAttributes)); |
|
206 | ||
207 | $newInput = array_map(function ($v) use ($availInput, $field) { |
|
@@ 207-213 (lines=7) @@ | ||
204 | }, $newColumn); |
|
205 | $attributes = array_clean_merge($attributes, array_filter($newAttributes)); |
|
206 | ||
207 | $newInput = array_map(function ($v) use ($availInput, $field) { |
|
208 | list($r, $k, $c) = explode('.', $v); |
|
209 | $v = "{$r}.{$k}"; |
|
210 | $embed = $field->getValidationInput([$field->column() => $availInput[$k][$c]]); |
|
211 | ||
212 | return $embed ? array_key_attach_str($embed, $v) : [null => 'null']; |
|
213 | }, $newColumn); |
|
214 | $newInputs = array_clean_merge($newInputs, array_filter($newInput, 'strlen', ARRAY_FILTER_USE_KEY)); |
|
215 | ||
216 | $newMessages = array_map(function ($v) use ($availInput, $field) { |
|
@@ 216-222 (lines=7) @@ | ||
213 | }, $newColumn); |
|
214 | $newInputs = array_clean_merge($newInputs, array_filter($newInput, 'strlen', ARRAY_FILTER_USE_KEY)); |
|
215 | ||
216 | $newMessages = array_map(function ($v) use ($availInput, $field) { |
|
217 | list($r, $k, $c) = explode('.', $v); |
|
218 | $v = "{$r}.{$k}"; |
|
219 | $embed = $field->getValidationMessages([$field->column() => $availInput[$k][$c]]); |
|
220 | ||
221 | return $embed ? array_key_attach_str($embed, $v) : null; |
|
222 | }, $newColumn); |
|
223 | $messages = array_clean_merge($messages, array_filter($newMessages)); |
|
224 | } else { |
|
225 | $fieldRules = is_array($fieldRules) ? implode('|', $fieldRules) : $fieldRules; |