EditEntityFieldAccessCheck::validateRequestAttributes

protected EditEntityFieldAccessCheck::validateRequestAttributes(EntityInterface $entity, $field_name, $langcode)

Validates request attributes.

File

core/modules/quickedit/src/Access/EditEntityFieldAccessCheck.php, line 50

Class

EditEntityFieldAccessCheck
Access check for editing entity fields.

Namespace

Drupal\quickedit\Access

Code

protected function validateRequestAttributes(EntityInterface $entity, $field_name, $langcode) {
  // Validate the field name and language.
  if (!$field_name || !$entity->hasField($field_name)) {
    return FALSE;
  }
  if (!$langcode || !$entity->hasTranslation($langcode)) {
    return FALSE;
  }

  return TRUE;
}
doc_Drupal
2016-10-29 09:03:33
Comments
Leave a Comment

Please login to continue.