hi iam using xpdo in a project
the getcollection(’table’,$query) is not working and its not fetching other tables data when using with join
my code is
$rq=$b2b->newQuery(’Rfp’);
$rq->leftJoin(’UserProfile’,’Reseller’,’`Rfp`.`reseller` = `Reseller`.`internalKey`’);
$rq->leftJoin(’CompanyJobtype’,’Job’,’`Rfp`.`jobType` = `Job`.`jobId`’);
$rq->select(array(’Rfp.*’,’Reseller.firstName’,’Reseller.lastName’,’Reseller.mobile’,’job.jobType’));
$rfps=$b2b->getCollection(’Rfp’,$rq);
foreach($rfps as $rfp){
$a=$rfp->toArray();
print_r($a);
}
i tried with toQuery(); and the sql returning with toquery is perfect
but in the getcollection result other tables data in not fetched
more importantly the join conditions also not counting when getcollection is fetched
just to clarify i have extended xpdo to b2b
not sure what i missed
-
MODX Staff
- 10,725 Posts
getCollection will not return objects represented by tables you have manually joined. This is what getCollectionGraph() is for.