You are here

protected function EditEntityFieldAccessCheck::validateRequestAttributes in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/quickedit/src/Access/EditEntityFieldAccessCheck.php \Drupal\quickedit\Access\EditEntityFieldAccessCheck::validateRequestAttributes()

Validates request attributes.

1 call to EditEntityFieldAccessCheck::validateRequestAttributes()
EditEntityFieldAccessCheck::access in core/modules/quickedit/src/Access/EditEntityFieldAccessCheck.php
Checks Quick Edit access to the field.

File

core/modules/quickedit/src/Access/EditEntityFieldAccessCheck.php, line 55
Contains \Drupal\quickedit\Access\EditEntityFieldAccessCheck.

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;
}