PHP Class NerdsAndCompany\Schematic\Models\Field

A schematic field model for mapping data
Author: Nerds & Company
Show file Open project: itmundi/schematic Class Usage Examples

Public Methods

Method Description
getDefinition ( Craft\FieldModel $field, $includeContext ) : array
populate ( array $fieldDefinition, Craft\FieldModel $field, string $fieldHandle, Craft\FieldGroupModel $group = null )

Protected Methods

Method Description
getFieldFactory ( ) : FieldFactory

Private Methods

Method Description
getMappedSources ( string $fieldType, string | array $sources, string $indexFrom, string $indexTo ) : array | string Get sources based on the indexFrom attribute and return them with the indexTo attribute.
getSource ( string $fieldType, string $source, string $indexFrom, string $indexTo ) : string Gets a source by the attribute indexFrom, and returns it with attribute $indexTo.

Method Details

getDefinition() public method

public getDefinition ( Craft\FieldModel $field, $includeContext ) : array
$field Craft\FieldModel
$includeContext
return array

getFieldFactory() protected method

protected getFieldFactory ( ) : FieldFactory
return FieldFactory

populate() public method

public populate ( array $fieldDefinition, Craft\FieldModel $field, string $fieldHandle, Craft\FieldGroupModel $group = null )
$fieldDefinition array
$field Craft\FieldModel
$fieldHandle string
$group Craft\FieldGroupModel