You are here

public function Taxonomy::getApplicableFields in Workbench Access 8

@inheritdoc

Overrides AccessControlHierarchyBase::getApplicableFields

4 calls to Taxonomy::getApplicableFields()
Taxonomy::alterForm in src/Plugin/AccessControlHierarchy/Taxonomy.php
Alters the selection options provided for an access control field.
Taxonomy::applies in src/Plugin/AccessControlHierarchy/Taxonomy.php
Check if this access scheme applies to the given entity.
Taxonomy::getEntityValues in src/Plugin/AccessControlHierarchy/Taxonomy.php
Retrieves the access control values from an entity.
Taxonomy::massageFormValues in src/Plugin/AccessControlHierarchy/Taxonomy.php
Massage form values as appropriate during entity submit.

File

src/Plugin/AccessControlHierarchy/Taxonomy.php, line 280

Class

Taxonomy
Defines a hierarchy based on a Vocabulary.

Namespace

Drupal\workbench_access\Plugin\AccessControlHierarchy

Code

public function getApplicableFields($entity_type, $bundle) {
  return array_filter($this->configuration['fields'], function ($field) use ($entity_type, $bundle) {
    $field += [
      'entity_type' => NULL,
      'bundle' => NULL,
      'field' => '',
    ];
    return $field['entity_type'] === $entity_type && $field['bundle'] === $bundle;
  });
}