You are here

protected function ActionCommonTrait::transformRulesValue in Content Access 8

Transforms the array of text values to an array keyed by $op and $rid.

2 calls to ActionCommonTrait::transformRulesValue()
ActionGrantNodePermissions::execute in src/Plugin/RulesAction/ActionGrantNodePermissions.php
Executes the plugin.
ActionRevokeNodePermissions::execute in src/Plugin/RulesAction/ActionRevokeNodePermissions.php
Executes the plugin.

File

src/Plugin/RulesAction/ActionCommonTrait.php, line 36

Class

ActionCommonTrait
Provides common functionality for Content Access Rules actions.

Namespace

Drupal\content_access\Plugin\RulesAction

Code

protected function transformRulesValue($value) {
  $array = [];
  foreach ($value as $op_role) {
    $parts = explode(':', $op_role);

    // The first item is $op and the second $rid.
    $array[$parts[0]][] = $parts[1];
  }
  return $array;
}