Cml\Db\Base::join PHP Метод

join() публичный Метод

join内联结
public join ( string | array $table, string $on, mixed $tablePrefix = null )
$table string | array 表名 要取别名时使用 [不带前缀表名 => 别名]
$on string 联结的条件 如:'c.cid = a.cid'
$tablePrefix mixed 表前缀
    public function join($table, $on, $tablePrefix = null)
    {
        is_null($tablePrefix) && ($tablePrefix = $this->tablePrefix);
        $this->table($table, $tablePrefix);
        $hasAlias = is_array($table) ? true : false;
        $tableName = $tablePrefix . ($hasAlias ? key($table) : $table);
        $this->join[count($this->table) - 1 . '_' . $tableName] = is_array($on) ? $this->parseOn($table, $on) : addslashes($on);
        return $this;
    }