You are here

function _rac_get_consumers in Role Access Control 8

Get Role Access Consumer plugins.

Return value

Drupal\rac\RoleAccessConsumerInterface[] All role Access Consumer Plugins.

1 call to _rac_get_consumers()
_rac_get_supported_entity_types in ./rac.module
Get entity types which have access controled by rac plugins.

File

./rac.module, line 302
Module providing role access relations.

Code

function _rac_get_consumers() {
  static $consumers = NULL;
  if ($consumers === NULL) {

    // Load pluging manager and get instances of plugin.
    $providerManager = \Drupal::service('plugin.manager.rac.rac_consumer');
    $providers = $providerManager
      ->getDefinitions();
    foreach ($providers as $provider) {
      $consumers[$provider["id"]] = $providerManager
        ->createInstance($provider["id"], []);
    }
  }
  return $consumers;
}