public function getEntityAccessFields($entity, $bundle) {
    $fields = [];
    $field_definitions = $this->entityManager->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;
  }
public function getEntityAccessFields($entity, $bundle) {
    $fields = [];
    $field_definitions = $this->entityManager->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;
  }
public function getEntityAccessFields ( $ entity , $ bundle ) { $ fields = [ ] ; $ field_definitions = $ this -> entityManager -> 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 ; }
Get all fields of type entity_access_field.

@return array
Returns all the fields with the entity type entity_acces_field.
Get all fields of type entity_access_field .