Exemplo n.º 1
0
 /**
  * This function will get us our field
  *
  * @param  integer $fieldId
  * @param  array $input
  * @return Field
  */
 protected function getFieldToUpdate($fieldId, $fieldInput, $pageInput)
 {
     $scope = array_get($fieldInput, 'scope');
     $newScope = array_get($fieldInput, 'new_scope', $scope);
     $field = $scope == 'global' ? $this->GlobalField->whereId($fieldId)->firstOrFail() : $this->Field->whereId($fieldId)->firstOrFail();
     if ($newScope !== $scope) {
         $field = $this->changeFieldScope($field, $newScope, $fieldInput, $pageInput);
     }
     return $field;
 }