public function toSql(BaseDriver $driver, ArgumentArray $args)
{
$sql = '';
if ($this->joinType) {
$sql .= ' ' . $this->joinType;
}
$sql .= ' JOIN ' . $this->table;
if ($this->alias) {
$sql .= ' AS ' . $this->alias;
}
if ($driver instanceof MySQLDriver) {
$sql .= $this->buildIndexHintClause($driver, $args);
}
if ($this->conditions->hasExprs()) {
$sql .= ' ON (' . $this->conditions->toSql($driver, $args) . ')';
}
return $sql;
}