Devise\Pages\Models\ModelManager::updateField PHP Method

updateField() public method

Updates a single field
public updateField ( [type] $field, [type] $page ) : [type]
$field [type]
$page [type]
return [type]
    public function updateField($field, $page)
    {
        $fields = $this->updateFields(array($field), $page);
        return $fields[0];
    }

Usage Example

Example #1
0
 /**
  * Updates a single model field for this model (attribute)
  *
  * @param  integer $modelFieldId
  * @param  array   $input
  * @return array
  */
 public function executeModelFieldUpdate($modelFieldId, $input)
 {
     try {
         $field = $this->ModelManager->updateField($input['field'], $input['page']);
     } catch (ModelFieldValidationFailedException $e) {
         return $this->Response->json(['errors' => $e->getErrors()], 403);
     }
     return array('field' => $field);
 }