PHP Class NerdsAndCompany\Schematic\Services\Fields

Sync Craft Setups.
Author: Nerds & Company
Inheritance: extends Base
Mostra file Open project: itmundi/schematic

Public Methods

Method Description
export ( array $groups = [] ) : array Export fields.
getFieldFactory ( ) : FieldFactory
getFieldLayout ( array $fieldLayoutDef ) : Craft\FieldLayoutModel Attempt to import a field layout.
getFieldLayoutDefinition ( Craft\FieldLayoutModel $fieldLayout ) : array Get field layout definition.
import ( array $groupDefinitions, boolean $force = false ) : Result Attempt to import fields.

Private Methods

Method Description
createFieldGroupModel ( string $group ) : Craft\FieldGroupModel Creates new or updates existing group model.
deleteFields ( ) Removes fields that where not imported.
deleteFieldsAndGroups ( ) Removes fields and groups that where not imported.
deleteGroups ( ) Removes groups that where not imported.
getContentService ( ) : ContentService Returns content service.
getFieldDefinition ( Craft\FieldModel $field ) : array Get field definition.
getFieldLayoutFieldsDefinition ( array $fields ) : array Get field layout fields definition.
getFieldModel ( string $field ) : Craft\FieldModel
getFieldsService ( ) : FieldsService Returns fields service.
getPrepareFieldLayout ( array $fieldLayoutDef ) : array Get a prepared fieldLayout for the craft assembleLayout function.
importFields ( array $fieldDefinitions, Craft\FieldGroupModel $group ) Import field group fields.
resetCraftFieldsServiceFieldsCache ( ) Reset craft fields service fields cache using reflection.
resetCraftFieldsServiceGroupsCache ( ) Reset craft fields service groups cache using reflection.
saveFieldGroupModel ( Craft\FieldGroupModel $group ) Save field group.
saveFieldModel ( Craft\FieldModel $field ) Save field.
unsetData ( string $name, array $definitions ) Unset group and field data else $force flag will delete it.
validateFieldModel ( Craft\FieldModel $field ) Validates field type, throw error when it's incorrect.

Method Details

export() public method

Export fields.
public export ( array $groups = [] ) : array
$groups array
return array

getFieldFactory() public method

public getFieldFactory ( ) : FieldFactory
return NerdsAndCompany\Schematic\Models\FieldFactory

getFieldLayout() public method

Attempt to import a field layout.
public getFieldLayout ( array $fieldLayoutDef ) : Craft\FieldLayoutModel
$fieldLayoutDef array
return Craft\FieldLayoutModel

getFieldLayoutDefinition() public method

Get field layout definition.
public getFieldLayoutDefinition ( Craft\FieldLayoutModel $fieldLayout ) : array
$fieldLayout Craft\FieldLayoutModel
return array

import() public method

Attempt to import fields.
public import ( array $groupDefinitions, boolean $force = false ) : Result
$groupDefinitions array
$force boolean if set to true items not in the import will be deleted
return Result