You are here

public function SectionAssociation::getCurrentRoleIds in Workbench Access 8

Returns an array of currently assigned role ids for the section.

Return value

array A positional array of role ids.

Overrides SectionAssociationInterface::getCurrentRoleIds

File

src/Entity/SectionAssociation.php, line 132

Class

SectionAssociation
Defines the workbench_access SectionAssociation class.

Namespace

Drupal\workbench_access\Entity

Code

public function getCurrentRoleIds() {
  $role_ids = [];
  if ($values = $this
    ->get('role_id')) {
    foreach ($values as $delta => $value) {
      $target = $value
        ->getValue();
      $role_ids[] = $target['target_id'];
    }
  }
  return $role_ids;
}