Skip to content

Instantly share code, notes, and snippets.

@jaguerra
Created May 7, 2013 15:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaguerra/5533655 to your computer and use it in GitHub Desktop.
Save jaguerra/5533655 to your computer and use it in GitHub Desktop.
RAW result query on Extbase
<?php
function findRaw(){
$localQuery = $this->createQuery();
$storagePageIds = $localQuery->getQuerySettings()->getStoragePageIds();
$querySettings = $localQuery->getQuerySettings();
$querySettings->setReturnRawQueryResult(TRUE);
$localQuery->setQuerySettings( $querySettings );
$localQuery->statement('select mm2.uid_foreign as ea, cl.uid as cl '.
' from tx_extension_domain_model_courselevels cl '.
' inner join tx_extension_serie_courselevels_mm mm on mm.uid_foreign = cl.uid '.
' inner join tx_extension_serie_educationalarea_mm mm2 on mm.uid_local = mm2.uid_local '.
' inner join tx_extension_domain_model_educationalarea ea on mm2.uid_foreign = ea.uid '.
' where cl.new != 0 '.
' AND cl.pid IN (' . implode(', ', $storagePageIds) . ') '.
' AND ea.pid IN (' . implode(', ', $storagePageIds) . ') '.
'order by ea.sorting, cl.sorting ');
$result = $localQuery->execute();
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment