FlexFormSchemaFactory
final readonly class \
Parses all possibles schemas of all sheets of a field.
Attributes
- #[Autoconfigure]
- $public: true
- $shared: true
Table of Contents
Methods
- __construct() : mixed
- getSchemaForRecord() : FlexFormSchema|null
- Currently this mixes Schema and Record Information, and could be handled in a cleaner way.
- getSchemaForRow() : FlexFormSchema|null
- Resolves the data structure of a flex field for a given database row, and creates schema field types for all fields of its sheets, including their relations.
Methods
__construct()
public
__construct(FlexFormTools $flexFormTools, FieldTypeFactory $fieldTypeFactory, TcaSchemaFactory $tcaSchemaFactory) : mixed
Parameters
- $flexFormTools : FlexFormTools
- $fieldTypeFactory : FieldTypeFactory
- $tcaSchemaFactory : TcaSchemaFactory
getSchemaForRecord()
Currently this mixes Schema and Record Information, and could be handled in a cleaner way.
public
getSchemaForRecord(RawRecord $record, FlexFormFieldType $field[, RelationMap|null $relationMap = null ]) : FlexFormSchema|null
This method signature will most likely change.
The relation map is not evaluated, relations of the sheet fields are resolved from their configuration.
Parameters
- $record : RawRecord
- $field : FlexFormFieldType
- $relationMap : RelationMap|null = null
Return values
FlexFormSchema|nullgetSchemaForRow()
Resolves the data structure of a flex field for a given database row, and creates schema field types for all fields of its sheets, including their relations.
public
getSchemaForRow(string $tableName, FlexFormFieldType $field, array $row) : FlexFormSchema|null
Returns null if no valid data structure can be resolved for the row. Fields of a type that is not available are omitted.
Parameters
- $tableName : string
- $field : FlexFormFieldType
- $row : array