Hi everyone,
I’m working on a application for my internship and I need to use the Innerjoin function.
This is the situation:
I have created a schema with a class called "companies" and a class called "locations".
I can output a list of the companies names but I want to output there locations aswel in the same htmltable, like Company name, City, Address, telephone etc.
How can I do this?
I tried:
$c = $modx->newQuery('companies');
$c->innerJoin('locations');
$companies = $modx->getCollection('companies', $c);
if($companies) {
foreach($companies as $company) {
$list .= $modx->getChunk($rowTpl,$company->toArray());
}
}
I can make the code work when I leave out the , $c but with it the code wont output anything
Anyone knows what I do wrong?