[TYPO3-mvc] query->Like

Christian Schwan - Dimme GmbH christian.schwan at dimme.ch
Wed Jun 16 11:21:01 CEST 2010


He Sören,

thx for awnser,

I have a array with

Array (
[0] => 1
[1] => 2
[3] => 3
...
...
)

Now I have to build with foreach array the Like query, but I think is not
possible to do this.

query->logicalOr(
  array(


foreach
    $query->like('firstname', '%' . $searchQuery . '%'),
end


    )
)


Have you any idea?



-----Ursprüngliche Nachricht-----
Von: typo3-project-typo3v4mvc-bounces at lists.typo3.org
[mailto:typo3-project-typo3v4mvc-bounces at lists.typo3.org] Im Auftrag von
Søren Malling
Gesendet: Mittwoch, 16. Juni 2010 08:17
An: TYPO3 v4 MVC project
Betreff: Re: [TYPO3-mvc] query->Like

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.ht
ml

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
_______________________________________________
TYPO3-project-typo3v4mvc mailing list
TYPO3-project-typo3v4mvc at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
Eingehende eMail ist virenfrei.
Von AVG Free SB überprüft - www.avg.de 
Version: 9.0.829 / Virendatenbank: 271.1.1/2936 - Ausgabedatum: 06/15/10
08:35:00 

Ausgehende eMail ist virenfrei.
Von AVG Free SB überprüft - www.avg.de 
Version: 9.0.829 / Virendatenbank: 271.1.1/2936 - Ausgabedatum: 06/15/10
20:35:00 



More information about the TYPO3-project-typo3v4mvc mailing list