[TYPO3-mvc] Query Statement and paginator

christian oettinger christian.oettinger at gmx.de
Thu Mar 24 19:20:50 CET 2011


> Hey,
>
>> $query = $this->createQuery();
>> $query->statement('...');
>> return $query->execute();
> ...
>> can anyone see a reason for that?
>> thanks in advance
>
> The paginate widget can't manipulate custom statements - easy as that.
> The Widget will use the method "setLimit" which will only be taken into
> account/processed if no custom statement was set. So you have to build
> your query using the QOM or write a own pagination Widget that'll parse
> and adjust raw SQL statements.
>

All right, that's logical and, yes, easy.
Thank you very much for answering!

That leads me to the next question, just to be sure: We are using raw 
SQL just for the fact that QOM is not capable of producing the query we 
need (FULLTEXT search, see below). If this is just a matter of our lack 
of knowledge, please let us know.
Another possibility we saw was to get a list of uids by a raw Query and 
then process this list by QOM. But with this solution we've heard we 
will be loosing the ordering (which is relevance in our FULLTEXT 
search). If there's a solution for that, we'd be happy too.

cheers!
christian (oe)

------------------------------------

$query = $this->createQuery();
$query->statement('
       SELECT *,
         MATCH (text)
           AGAINST('.$searchstring1.' IN BOOLEAN MODE) AS mtch1,
         MATCH (text)
           AGAINST('.$searchstring2.') AS mtch2
       FROM tx_arztcme_domain_model_training
       WHERE
         (available_until >= 1
           AND available_until >= '.$date.'
           )
         OR (available_until = 0
           AND crdate >= ('.$date.'-60*60*24*365)
           )
       HAVING mtch1 > 0 OR
       vnr LIKE "'.$searchword.'"
       ORDER BY mtch2 DESC, crdate DESC
     ');
return $query->execute();


More information about the TYPO3-project-typo3v4mvc mailing list