[TYPO3-mvc] Define a field of a query as a sub query

Matthew Colton mat.colton at web-xs.de
Mon Jun 30 07:50:39 CEST 2014


Hallo,
how can a field of a query be defined as a sub query, for example
SELECT
  tx_myext_domain_model_eventdate.*,
  (
    SELECT SUM(amount)
    FROM tx_myext_domain_model_reservation
    WHERE tx_myext_domain_model_reservation.event_date =
               tx_myext_domain_model_eventdate.uid
  )
FROM tx_myext_domain_model_eventdate
WHERE ...

ATM I'm using a view helper on the eventdate result. That means the
eventdate result has no SUM() field, but while looping through the
paginator result I call a viewhelper that does the job. Is there any way
to do that directly in the query object? Maybe via a getter method in
the model?
-- 
Cheers
Matthew


More information about the TYPO3-project-typo3v4mvc mailing list