Devise\Pages\Fields\FieldManager::changeFieldScope PHP Méthode

changeFieldScope() protected méthode

Changes the field scope
protected changeFieldScope ( DvsField | DvsGlobalField $field, string $newScope, $fieldInput, $pageInput ) : DvsField | DvsGlobalField
$field DvsField | DvsGlobalField
$newScope string
Résultat DvsField | DvsGlobalField
    protected function changeFieldScope($field, $newScope, $fieldInput, $pageInput)
    {
        if ($newScope == 'global') {
            $field->delete();
            // delete the page field so the global field can take over
            return $this->changeToGlobalField($fieldInput, $pageInput);
        }
        return $this->changeToPageField($fieldInput, $pageInput);
    }