[TYPO3-mvc] Query fields of external table

Michael Ruhdorfer michael.ruhdorfer.1line at gmail.com
Thu Feb 17 08:48:12 CET 2011


hi franz
> 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?
>

my ts config looks like

config.tx_extbase.persistence.classes {
   Tx_MyExt_Domain_Model_User.mapping {
     tableName = fe_users
   }
}

when I try to access $user->getUsername() the username is found - 
generally it seems as if the mapping works, but not in that particular 
case... setting the storagePid has no effect either


More information about the TYPO3-project-typo3v4mvc mailing list