[TYPO3-mvc] $query->like() replaces operand with "?"

Søren Malling soren.malling at gmail.com
Mon May 31 13:25:54 CEST 2010


Hi,

I got the following query object

        public function findByTelephoneAndName($searchQuery) {
                $query = $this->createQuery();
                $query = $query->matching(
                                        $query->logicalOr(

$query->like('firstname', (string)'%'.$searchQuery.'%')
                #
$query->like('lastname', '%'.$searchQuery.'%')
                #
$query->like('telephone', '%'.$searchQuery.'%')
                                        )
                                )->setLimit((integer) 10);
                return $query->execute();
        }

but no matter how I insert the $searchQuery variable the statement is
returned as

... where fe_users.tx_ext_field LIKE ? ...

even if I replace the variable with a static string.

I've been debugging the like() function at it returns a object with my
operand so for some reason it looks like it "goes wrong" in the
execute() or matching() part (parts I haven't debugged due to lack of
time).

Anyone eperienced this issue when creating own query object?

Regards,

Søren

-- 
Certified TYPO3 Integrator


More information about the TYPO3-project-typo3v4mvc mailing list