[TYPO3-mvc] MM_opposite_field
Christian Baer
chr.baer at googlemail.com
Thu Jun 10 12:05:20 CEST 2010
Am 10.06.10 12:05, schrieb Jochen Rau:
> Hi Christian.
>
> On 2010-06-10, Christian Baer<chr.baer at googlemail.com> wrote:
>> My tables have underscores, maybe this is a problem? How do I have to
>> write the table in the $query?
>>
>> $query->equals("table_name.field", $value);
>>
>> OR
>>
>> $query->equals("tableName.field", $value);
>
> Don't think in tables and fields, but think in objects and properties. The query object has no clue about the concept of databases and tables.
>
> If you are in the repository responsible for Tx_MyExt_Domain_Model_MyObject then you have to write
>
> $query->equals("propertyName", $value);
>
> The dot might be a little bit confusing here as it is used in SQL to prefix field names with the table name.
>
> Regards
> Jochen
>
Hi Jochen,
but I try to contrain the query to a field from a MM-connected table.
Thats why in the repository responsible for
Tx_MyExt_Domain_Model_MyObject I use:
$query->equals("myConnectedObject.propertyName", $value);
This works fine from one side, but not from the "opposite side".
Regards
Chris
More information about the TYPO3-project-typo3v4mvc
mailing list