I have a schema using xpdosimpleobject's, which of course gives me a primary key of id by default. When I try to build a join query, I get the "Column 'id' in field list is ambiguous" error. Is there a way around this, or do I just need to rebuild these tables with a custom pk field?
Example of my code:
$c = $this->modx->newQuery('primaryObject');
$c->select($this->modx->getSelectColumns('primaryObject'));
$c->select(array(
'secobj.item_qty'
,'secobj.id AS secobj_id'
));
$c->leftJoin('secondObject','secobj','primaryObject.id=secobj.ref_id');
$c->where(array(
'active' => true
,'secobj.ref_id' => $ref_id
));
//
$items = $this->modx->getCollection('primaryObject',$c);