function joinAllById($tableMap, $baseTable) { $sql = ''; reset($tableMap); foreach ($tableMap as $table => $ignoored) if ($table != $baseTable) $sql .= "\n INNER JOIN $table ON $table.id = $baseTable.id"; $this->query .= $sql; return $sql; }