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

parseOn() защищенный Метод

解析联结的on参数
protected parseOn ( string &$table, array $on ) : string
$table string 要联结的表名
$on array ['on条件1', 'on条件2' => true] on条件为数字索引时多条件默认为and为非数字引时 条件=>true为and 条件=>false为or
Результат string
    protected function parseOn(&$table, $on)
    {
        if (empty($on)) {
            throw new \InvalidArgumentException(Lang::get('_DB_PARAM_ERROR_PARSE_ON_', $table));
        }
        $result = '';
        foreach ($on as $key => $val) {
            if (is_numeric($key)) {
                $result == '' || ($result .= ' AND ');
                $result .= $val;
            } else {
                $result == '' || ($result .= $val === true ? ' AND ' : ' OR ');
                $result .= $key;
            }
        }
        return addslashes($result);
        //on条件是程序员自己写死的表字段名不存在注入以防万一还是过滤一下
    }