You are here

public function EntityAccessByFieldPermissions::getEntityAccessFields in Open Social 10.0.x

Same name and namespace in other branches
  1. 8.9 modules/custom/entity_access_by_field/src/EntityAccessByFieldPermissions.php \Drupal\entity_access_by_field\EntityAccessByFieldPermissions::getEntityAccessFields()
  2. 8 modules/custom/entity_access_by_field/src/EntityAccessByFieldPermissions.php \Drupal\entity_access_by_field\EntityAccessByFieldPermissions::getEntityAccessFields()
  3. 8.2 modules/custom/entity_access_by_field/src/EntityAccessByFieldPermissions.php \Drupal\entity_access_by_field\EntityAccessByFieldPermissions::getEntityAccessFields()
  4. 8.3 modules/custom/entity_access_by_field/src/EntityAccessByFieldPermissions.php \Drupal\entity_access_by_field\EntityAccessByFieldPermissions::getEntityAccessFields()
  5. 8.4 modules/custom/entity_access_by_field/src/EntityAccessByFieldPermissions.php \Drupal\entity_access_by_field\EntityAccessByFieldPermissions::getEntityAccessFields()
  6. 8.5 modules/custom/entity_access_by_field/src/EntityAccessByFieldPermissions.php \Drupal\entity_access_by_field\EntityAccessByFieldPermissions::getEntityAccessFields()
  7. 8.6 modules/custom/entity_access_by_field/src/EntityAccessByFieldPermissions.php \Drupal\entity_access_by_field\EntityAccessByFieldPermissions::getEntityAccessFields()
  8. 8.7 modules/custom/entity_access_by_field/src/EntityAccessByFieldPermissions.php \Drupal\entity_access_by_field\EntityAccessByFieldPermissions::getEntityAccessFields()
  9. 8.8 modules/custom/entity_access_by_field/src/EntityAccessByFieldPermissions.php \Drupal\entity_access_by_field\EntityAccessByFieldPermissions::getEntityAccessFields()
  10. 10.3.x modules/custom/entity_access_by_field/src/EntityAccessByFieldPermissions.php \Drupal\entity_access_by_field\EntityAccessByFieldPermissions::getEntityAccessFields()
  11. 10.1.x modules/custom/entity_access_by_field/src/EntityAccessByFieldPermissions.php \Drupal\entity_access_by_field\EntityAccessByFieldPermissions::getEntityAccessFields()
  12. 10.2.x modules/custom/entity_access_by_field/src/EntityAccessByFieldPermissions.php \Drupal\entity_access_by_field\EntityAccessByFieldPermissions::getEntityAccessFields()

Get all fields of type entity_access_field.

Return value

array Returns all the fields with the entity type entity_acces_field.

2 calls to EntityAccessByFieldPermissions::getEntityAccessFields()
EntityAccessByFieldPermissions::getRealmWithPermission in modules/custom/entity_access_by_field/src/EntityAccessByFieldPermissions.php
Get the realms array with permissions as value.
EntityAccessByFieldPermissions::permissions in modules/custom/entity_access_by_field/src/EntityAccessByFieldPermissions.php
Return all the permissions generated by this user.

File

modules/custom/entity_access_by_field/src/EntityAccessByFieldPermissions.php, line 163

Class

EntityAccessByFieldPermissions
EntityAccessByFieldPermissions.

Namespace

Drupal\entity_access_by_field

Code

public function getEntityAccessFields($entity, $bundle) {
  $fields = [];
  $field_definitions = $this->entityFieldManager
    ->getFieldDefinitions($entity, $bundle
    ->id());
  foreach ($field_definitions as $field_name => $field_definition) {
    if (!empty($field_definition
      ->getTargetBundle())) {
      if ($field_definition
        ->getType() === 'entity_access_field') {
        $fields[$field_name] = $field_definition;
      }
    }
  }
  return $fields;
}