Feature #31803

Accessing Query Builder

Added by Carsten Bleicker about 10 years ago. Updated almost 7 years ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
Persistence
Target version:
-
Start date:
2011-11-14
Due date:
% Done:

100%

Estimated time:
PHP Version:
5.3
Has patch:
No
Complexity:

Description

Hi Folks,
i need a special query with additional fields in select statement and a HAVING.
for example:
$query = "SELECT ort, plz, (
".$radius." * SQRT) *
cos(".$rad_b.") * (sin(RADIANS) *
sin(".$rad_l.") + cos(RADIANS) *
cos(".$rad_l.")) - sin(RADIANS) * sin(".$rad_b.")))) AS Distance
FROM plz Having Distance <= ".$umkreis."
ORDER BY Distance
";

as far as i know i can add special fields with:
$this->queryBuilder()->add(); by the queryBuilder of \TYPO3\FLOW3\Persistence\Doctrine\Query.
But the query builder is protected and there is no getter for it.
It is a good or a bad idea to add public function getQueryBuilder into the Query Class to enable a usage like:
$this->query->getQueryBuilder->add('select'...)?

if anybody could tell me how to do the query above, please tell me.

thanks a lot!
carsten

Also available in: Atom PDF