protected function buildShowMeta($showMeta, &$params)
    {
        if (empty($showMeta)) {
            return '';
        }
        $sql = 'SHOW META';
        if (is_bool($showMeta)) {
            return $sql;
        }

        if ($showMeta instanceof Expression) {
            foreach ($showMeta->params as $n => $v) {
                $params[$n] = $v;
            }
            $phName = $showMeta->expression;
        } else {
            $phName = self::PARAM_PREFIX . count($params);
            $escape = ['%'=>'\%', '_'=>'\_', '\\'=>'\\\\'];
            $params[$phName] = '%' . strtr($showMeta, $escape) . '%';
        }

        $sql .= " LIKE {$phName}";
        return $sql;
    }
protected function buildShowMeta($showMeta, &$params)
    {
        if (empty($showMeta)) {
            return '';
        }
        $sql = 'SHOW META';
        if (is_bool($showMeta)) {
            return $sql;
        }

        if ($showMeta instanceof Expression) {
            foreach ($showMeta->params as $n => $v) {
                $params[$n] = $v;
            }
            $phName = $showMeta->expression;
        } else {
            $phName = self::PARAM_PREFIX . count($params);
            $escape = ['%'=>'\%', '_'=>'\_', '\\'=>'\\\\'];
            $params[$phName] = '%' . strtr($showMeta, $escape) . '%';
        }

        $sql .= " LIKE {$phName}";
        return $sql;
    }
protected function buildShowMeta ( $ showMeta , & $ params ) { if ( empty ( $ showMeta ) ) { return '' ; } $ sql = 'SHOW META' ; if ( is_bool ( $ showMeta ) ) { return $ sql ; } if ( $ showMeta instanceof Expression ) { foreach ( $ showMeta -> params as $ n => $ v ) { $ params [ $ n ] = $ v ; } $ phName = $ showMeta -> expression ; } else { $ phName = self :: PARAM_PREFIX . count ( $ params ) ; $ escape = [ '%' => '\%' , '_' => '\_' , '\\' => '\\\\' ] ; $ params [ $ phName ] = '%' . strtr ( $ showMeta , $ escape ) . '%' ; } $ sql .= " LIKE {$phName}" ; return $ sql ; }
Builds SHOW META query.
@param bool|string|Expression $showMeta show meta specification.
@param array $params the binding parameters to be populated
@return string SHOW META query, if it does not required - empty string.
Builds SHOW META query .