PHP Class Devise\Pages\Fields\FieldManager

Mostrar archivo Open project: devisephp/cms Class Usage Examples

Public Methods

Method Description
__construct ( DvsField $Field, DvsGlobalField $GlobalField, FieldsRepository $FieldsRepository, Framework $Framework ) Construct a new Field Manager
markNoContentRequested ( array $fieldIds ) : boolean Sets a series of fields content requested to false
resetField ( integer $fieldId, $scope ) : DvsField Reset field values
updateField ( integer $fieldId, array $input ) : DvsField Updates the field

Protected Methods

Method Description
changeFieldScope ( DvsField | DvsGlobalField $field, string $newScope, $fieldInput, $pageInput ) : DvsField | DvsGlobalField Changes the field scope
changeToGlobalField ( array $fieldInput, array $pageInput ) : DvsGlobalField Changes this page field to a global field
changeToPageField ( array $fieldInput, array $pageInput ) : DvsField Changes this global field to a page field
getFieldToUpdate ( integer $fieldId, $fieldInput, $pageInput ) : Field This function will get us our field
newGlobalField ( $languageId, $key, $type, $humanName ) : PageField Create page field given input
newPageField ( $pageVersionId, $key, $type, $humanName ) : PageField Create page field given input
removePristinePageFields ( $key ) : void Removes the pristine page fields for this global field. We only do this when we *first* create the global field

Method Details

__construct() public method

Construct a new Field Manager
public __construct ( DvsField $Field, DvsGlobalField $GlobalField, FieldsRepository $FieldsRepository, Framework $Framework )
$Field DvsField
$GlobalField DvsGlobalField
$FieldsRepository FieldsRepository
$Framework Devise\Support\Framework

changeFieldScope() protected method

Changes the field scope
protected changeFieldScope ( DvsField | DvsGlobalField $field, string $newScope, $fieldInput, $pageInput ) : DvsField | DvsGlobalField
$field DvsField | DvsGlobalField
$newScope string
return DvsField | DvsGlobalField

changeToGlobalField() protected method

Changes this page field to a global field
protected changeToGlobalField ( array $fieldInput, array $pageInput ) : DvsGlobalField
$fieldInput array
$pageInput array
return DvsGlobalField

changeToPageField() protected method

Changes this global field to a page field
protected changeToPageField ( array $fieldInput, array $pageInput ) : DvsField
$fieldInput array
$pageInput array
return DvsField

getFieldToUpdate() protected method

This function will get us our field
protected getFieldToUpdate ( integer $fieldId, $fieldInput, $pageInput ) : Field
$fieldId integer
return Field

markNoContentRequested() public method

Sets a series of fields content requested to false
public markNoContentRequested ( array $fieldIds ) : boolean
$fieldIds array Array of field ids
return boolean

newGlobalField() protected method

Create page field given input
protected newGlobalField ( $languageId, $key, $type, $humanName ) : PageField
return PageField

newPageField() protected method

Create page field given input
protected newPageField ( $pageVersionId, $key, $type, $humanName ) : PageField
return PageField

removePristinePageFields() protected method

Removes the pristine page fields for this global field. We only do this when we *first* create the global field
protected removePristinePageFields ( $key ) : void
return void

resetField() public method

Reset field values
public resetField ( integer $fieldId, $scope ) : DvsField
$fieldId integer
return DvsField | \DvsGlobalField

updateField() public method

Updates the field
public updateField ( integer $fieldId, array $input ) : DvsField
$fieldId integer
$input array
return DvsField | \DvsGlobaField