/** * registerQueryTables * * @param Query $query * * @return Query */ public function registerQueryTables(Query $query) { foreach ($this->tables as $alias => $table) { if ($table['join'] == 'FROM') { $query->from($query->quoteName($table['name']) . ' AS ' . $query->quoteName($alias)); } else { $query->join($table['join'], $query->quoteName($table['name']) . ' AS ' . $query->quoteName($alias) . ' ' . $table['condition']); } } return $query; }