Hey!
I’ve got a question regarding a xPDO query:
I’ve got a custom entity (code is simplified)
<model baseClass="xPDOObject">
<object class="MyEntity" table="my_entity"
extends="xPDOSimpleObject">
<field key="user" dbtype="int" precision="11" phptype="integer"
null="false" default="0" index="index" />
<field key="createdOn" dbtype="datetime" phptype="datetime"
null="false" />
<aggregate alias="User" class="modUser" local="user"
foreign="id" cardinality="one" owner="foreign" />
</object>
</model>
I’d like to query all myEntity joined with the User AND the UserProfile.
I tried
$c = $modx->newQuery('MyEntity');
$c->leftJoin('modUser','User');
$c->leftJoin('modUserProfile','Profile');
but this seems not to work because there is no "Profile" aggregation defined in my schema.
I refered to
http://api.modxcms.com/xpdo/om/xPDOQuery.html#leftJoin and
http://api.modxcms.com/xpdo/om/xPDOQuery.html#leftJoin. But I didn’t get it to work.
Any hints?
Add-On to easily manage your multilingual sites:
Babel
Ok, so there’s no possibility to perform this join without adding a profile column to my custom table instead of joining the Profile via the user table?
Add-On to easily manage your multilingual sites:
Babel
Thanks a lot!
Now I’ve got what I was looking for!
Add-On to easily manage your multilingual sites:
Babel