original_string: protected function convertAclToQueryArray(AclInterface $acl, $principalControl, $permissionControl)
      {
          $acesArray = [];
          $principalCounter = 0;
  
          foreach ($acl->getAces() as $ace) {
              $permissions = $ace->getPermissions();
              if ($ace->getPrincipal() !== null && $ace->getPrincipal()->getId() && !empty($permissions)) {
                  $acesArray[$principalControl][$principalCounter] = $ace->getPrincipal()->getId();
                  $permissionCounter = 0;
                  $acesArray[$permissionControl][$principalCounter] = [];
  
                  foreach ($permissions as $permission) {
                      $acesArray[$permissionControl][$principalCounter][$permissionCounter] = $permission;
                      $permissionCounter ++;
                  }
  
                  $principalCounter ++;
              }
          }
  
          return $acesArray;
      }
code: protected function convertAclToQueryArray(AclInterface $acl, $principalControl, $permissionControl)
      {
          $acesArray = [];
          $principalCounter = 0;
  
          foreach ($acl->getAces() as $ace) {
              $permissions = $ace->getPermissions();
              if ($ace->getPrincipal() !== null && $ace->getPrincipal()->getId() && !empty($permissions)) {
                  $acesArray[$principalControl][$principalCounter] = $ace->getPrincipal()->getId();
                  $permissionCounter = 0;
                  $acesArray[$permissionControl][$principalCounter] = [];
  
                  foreach ($permissions as $permission) {
                      $acesArray[$permissionControl][$principalCounter][$permissionCounter] = $permission;
                      $permissionCounter ++;
                  }
  
                  $principalCounter ++;
              }
          }
  
          return $acesArray;
      }
code_tokens: protected function convertAclToQueryArray ( AclInterface $ acl , $ principalControl , $ permissionControl ) { $ acesArray = [ ] ; $ principalCounter = 0 ; foreach ( $ acl -> getAces ( ) as $ ace ) { $ permissions = $ ace -> getPermissions ( ) ; if ( $ ace -> getPrincipal ( ) !== null && $ ace -> getPrincipal ( ) -> getId ( ) && ! empty ( $ permissions ) ) { $ acesArray [ $ principalControl ] [ $ principalCounter ] = $ ace -> getPrincipal ( ) -> getId ( ) ; $ permissionCounter = 0 ; $ acesArray [ $ permissionControl ] [ $ principalCounter ] = [ ] ; foreach ( $ permissions as $ permission ) { $ acesArray [ $ permissionControl ] [ $ principalCounter ] [ $ permissionCounter ] = $ permission ; $ permissionCounter ++ ; } $ principalCounter ++ ; } } return $ acesArray ; }
docstring: Converts a Access Control list into an array that can be used for the CMIS request
  
  @param AclInterface $acl
  @param string $principalControl one of principal ace constants
  CONTROL_ADD_ACE_PRINCIPAL or CONTROL_REMOVE_ACE_PRINCIPAL
  @param string $permissionControl one of permission ace constants
  CONTROL_REMOVE_ACE_PRINCIPAL or CONTROL_REMOVE_ACE_PERMISSION
  @return array Example <code>
  array('addACEPrincipal' => array(0 => 'principalId'),
  'addACEPermission' => array(0 => array(0 => 'permissonValue')))
  </code>
docstring_tokens: Converts a Access Control list into an array that can be used for the CMIS request