Exemple #1
0
 /**
  * Transforms a Resource from a database query to an array of rows.
  *
  * @param resource $result The result
  * @return array The result as an array of rows (tuples)
  */
 protected function getRowsFromResult($result)
 {
     $rows = array();
     while ($row = $this->databaseHandle->sql_fetch_assoc($result)) {
         if (is_array($row)) {
             // Get language uid from querySettings.
             // Ensure the backend handling is not broken (fallback to Get parameter 'L' if needed)
             $overlaidRow = $this->doLanguageAndWorkspaceOverlay($this->query->getSource(), $row, $this->query->getQuerySettings());
             $contentObject = GeneralUtility::makeInstance($this->objectType, $this->query->getType(), $overlaidRow);
             $rows[] = $contentObject;
         }
     }
     return $rows;
 }
 /**
  * Post-process the constraints object to respect the file mounts.
  *
  * @param Query $query
  * @param ConstraintInterface|NULL $constraints
  * @return void
  */
 public function addFilePermissionsForFileMounts(Query $query, $constraints)
 {
     if ($query->getType() === 'sys_file') {
         if (!$this->getCurrentBackendUser()->isAdmin()) {
             $this->respectFileMounts($query, $constraints);
         }
     }
 }