private function Controller::updateAces

Persists the changes which were made to ACEs to the database.

Parameters

\SplObjectStorage $aces:

Return value

void

File

drupal/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/Controller.php, line 275

Class

Controller
@Route("/someprefix") @author Johannes M. Schmitt <schmittjoh@gmail.com>

Namespace

Doctrine\Tests\Common\Annotations\Fixtures

Code

private function updateAces(\SplObjectStorage $aces) {
  foreach ($aces as $ace) {
    $propertyChanges = $aces
      ->offsetGet($ace);
    $sets = array();
    if (isset($propertyChanges['mask'])) {
      $sets[] = sprintf('mask = %d', $propertyChanges['mask'][1]);
    }
    if (isset($propertyChanges['strategy'])) {
      $sets[] = sprintf('granting_strategy = %s', $this->connection
        ->quote($propertyChanges['strategy']));
    }
    if (isset($propertyChanges['aceOrder'])) {
      $sets[] = sprintf('ace_order = %d', $propertyChanges['aceOrder'][1]);
    }
    if (isset($propertyChanges['auditSuccess'])) {
      $sets[] = sprintf('audit_success = %s', $this->connection
        ->getDatabasePlatform()
        ->convertBooleans($propertyChanges['auditSuccess'][1]));
    }
    if (isset($propertyChanges['auditFailure'])) {
      $sets[] = sprintf('audit_failure = %s', $this->connection
        ->getDatabasePlatform()
        ->convertBooleans($propertyChanges['auditFailure'][1]));
    }
    $this->connection
      ->executeQuery($this
      ->getUpdateAccessControlEntrySql($ace
      ->getId(), $sets));
  }
}