public function countRecords($request)
 {
     $requestCleaner = new DataQueryControllerRequestCleaner();
     $adjustedRequest = $requestCleaner->adjustRequest($request);
     $result = NULL;
     if ($adjustedRequest instanceof DataQueryControllerRequestTree) {
         // it is possible that whole tree or some branches of the tree need to be joined manually
         throw new UnsupportedOperationException();
     } elseif ($adjustedRequest instanceof DataQueryControllerDatasetRequest) {
         $result = $this->executeDatasetCountRequest($adjustedRequest);
     } elseif ($adjustedRequest instanceof DataQueryControllerCubeRequest) {
         $result = $this->executeCubeCountRequest($adjustedRequest);
     }
     return $result;
 }
    public function countRecords($request) {
        $requestCleaner = new DataQueryControllerRequestCleaner();
        $adjustedRequest = $requestCleaner->adjustRequest($request);

        $result = NULL;
        if ($adjustedRequest instanceof DataQueryControllerDatasetRequest) {
            $result = $this->executeDatasetCountRequest($adjustedRequest);
        }
        elseif ($adjustedRequest instanceof DataQueryControllerCubeRequest) {
            $result = $this->executeCubeCountRequest($adjustedRequest);
        }
        elseif (isset($adjustedRequest)) {
            throw new UnsupportedOperationException();
        }

        return $result;
    }