[TYPO3-mvc] Query fields of external table

Franz Koch typo3.RemoveForMessage at elements-net.de
Wed Feb 16 17:47:54 CET 2011


Hey,

> I am trying to do a search where (a user has products) the username
> should be found. I am trying to access the user in the products repository:
>
> $constraints[] = $query->like('user.username', '%'.$keyword.'%');
>
> but it seems as if the wrong table is searched through, for I am using
> the fe_users table, the error message I get is as following:
>
> #1247602160: You have an error in your SQL syntax; check the manual that
> corresponds to your MySQL server version for the right syntax to use
> near 'ON tx_myext_domain_model_products.user=.uid WHERE (((((( ... OR
> username LIKE '%keyword%')
>
> When I change 'user.username' to 'user' and I am searching the ids, the
> result is returned the right way. What am I doing wrong, or isn't that
> possible (yet)?

it's possible, but it seems that extbase can't resolve the correct table 
name for your user object. Have you provided the needed mapping 
informations for your (probably custom) user object class via TS?

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list