original_string: public function find($class, DataRequest $dataRequest)
      {
          try {
              $dataRequest->setSelectedFields(array('*'));
              
              $queryBuilder = $this->entityManager->getQueryBuilder();
              $this->entityManager->buildDataRequestQuery($dataRequest, $queryBuilder, $class, 'a');
              
              $accessEntities = $queryBuilder->getQuery()->getResult();
              if ($accessEntities == null) {
                  return array();
              }
              
              foreach ($accessEntities as $accessEntity) {
                  $this->loadPermissions($accessEntity);
              }
              
              return $accessEntities;
          } catch (\Exception $e) {
              throw new Exception('Cannot load the access entities for the given data request from the database.', 0, $e);
          }
      }
code: public function find($class, DataRequest $dataRequest)
      {
          try {
              $dataRequest->setSelectedFields(array('*'));
              
              $queryBuilder = $this->entityManager->getQueryBuilder();
              $this->entityManager->buildDataRequestQuery($dataRequest, $queryBuilder, $class, 'a');
              
              $accessEntities = $queryBuilder->getQuery()->getResult();
              if ($accessEntities == null) {
                  return array();
              }
              
              foreach ($accessEntities as $accessEntity) {
                  $this->loadPermissions($accessEntity);
              }
              
              return $accessEntities;
          } catch (\Exception $e) {
              throw new Exception('Cannot load the access entities for the given data request from the database.', 0, $e);
          }
      }
code_tokens: public function find ( $ class , DataRequest $ dataRequest ) { try { $ dataRequest -> setSelectedFields ( array ( '*' ) ) ; $ queryBuilder = $ this -> entityManager -> getQueryBuilder ( ) ; $ this -> entityManager -> buildDataRequestQuery ( $ dataRequest , $ queryBuilder , $ class , 'a' ) ; $ accessEntities = $ queryBuilder -> getQuery ( ) -> getResult ( ) ; if ( $ accessEntities == null ) { return array ( ) ; } foreach ( $ accessEntities as $ accessEntity ) { $ this -> loadPermissions ( $ accessEntity ) ; } return $ accessEntities ; } catch ( \ Exception $ e ) { throw new Exception ( 'Cannot load the access entities for the given data request from the database.' , 0 , $ e ) ; } }
docstring: Returns an array with all found access entities for the given DataRequest
  object.
  
  @param string $class
  @param \Zepi\Core\Utils\DataRequest $dataRequest
  @return array
  
  @throws \Zepi\Core\AccessControl\Exception Cannot load the access entities for the given data request.
docstring_tokens: Returns an array with all found access entities for the given DataRequest object .