| | |
| | | */ |
| | | protected function getSanitizeCallback(array $field): callable |
| | | { |
| | | return fn($value) => MetaSanitizer::sanitize($value, $field); |
| | | return fn($value) => Sanitizer::sanitize($value, $field); |
| | | } |
| | | |
| | | protected function getFieldSchema(array $field): array |
| | | { |
| | | if ($field['type'] === 'repeater') { |
| | | $properties = []; |
| | | foreach ($field['fields'] as $key => $subfield) { |
| | | $properties[$key] = [ |
| | | 'type' => MetaTypeManager::getMetaType($subfield['type']) |
| | | ]; |
| | | } |
| | | $properties = array_map(function ($subfield) { |
| | | return [ |
| | | 'type' => MetaTypeManager::getMetaType($subfield['type']) |
| | | ]; |
| | | }, $field['fields']); |
| | | |
| | | return [ |
| | | 'type' => 'object', |