[TYPO3-mvc] query->Like

Søren Malling soren.malling at gmail.com
Wed Jun 16 08:17:08 CEST 2010


Hi Christian,

If you add the ->like inside the logicalOr, the MySql output is as expected.

$query = $query->matching(
     $query->logicalOr(
         array(
             $query->like('firstname', '%' . $searchQuery . '%'),
             $query->like('lastname', '%' . $searchQuery . '%'),
             $query->like('telephone', '%' . $searchQuery . '%')
         )
     )
);

This creates a "or" statement with each "like"

http://lists.typo3.org/pipermail/typo3-project-typo3v4mvc/2010-May/004993.html

Regards,

Søren

On 6/16/10, Christian Schwan - Dimme GmbH <christian.schwan at dimme.ch> wrote:
> He guys
>
> I got a problem with repository:
>
> $query->like('floorings', $flooring);
>
> Return: floorings LIKE '(%1%)'
>
> But it should return
>
> floorings LIKE (%1%)
>
> without the quotes...
>
> Because I need the query like:
>
> floorings LIKE (%1%) OR (%2%)
>
> does anyone can help me?
>
>
>
> Ausgehende eMail ist virenfrei.
> Von AVG Free SB uberpruft - www.avg.de
> Version: 9.0.829 / Virendatenbank: 271.1.1/2936 - Ausgabedatum: 06/15/10
> 08:35:00
>
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
>


-- 
Certified TYPO3 Integrator


More information about the TYPO3-project-typo3v4mvc mailing list