public function toSQL(Parameters $params, bool $inner_clause)
    {
        if ($key = $this->getKey())
        {
            try
            {
                $params->get($key);
            }
            catch (\OutOfRangeException $e)
            {
                $key = null;
            }
        }

        if ($key === null)
        {
            $val = $this->getValue();
            if (is_bool($val))
                $val = $val ? 1 : 0;
            $key = $params->assign($val, $this->getParameterType());
        }
        $this->bind($params, $key, null);

        return ':' . $key;
    }
public function toSQL(Parameters $params, bool $inner_clause)
    {
        if ($key = $this->getKey())
        {
            try
            {
                $params->get($key);
            }
            catch (\OutOfRangeException $e)
            {
                $key = null;
            }
        }

        if ($key === null)
        {
            $val = $this->getValue();
            if (is_bool($val))
                $val = $val ? 1 : 0;
            $key = $params->assign($val, $this->getParameterType());
        }
        $this->bind($params, $key, null);

        return ':' . $key;
    }
public function toSQL ( Parameters $ params , bool $ inner_clause ) { if ( $ key = $ this -> getKey ( ) ) { try { $ params -> get ( $ key ) ; } catch ( \ OutOfRangeException $ e ) { $ key = null ; } } if ( $ key === null ) { $ val = $ this -> getValue ( ) ; if ( is_bool ( $ val ) ) $ val = $ val ? 1 : 0 ; $ key = $ params -> assign ( $ val , $ this -> getParameterType ( ) ) ; } $ this -> bind ( $ params , $ key , null ) ; return ':' . $ key ; }
Write a constant as SQL query syntax
@param Parameters $params The query parameters: tables and placeholder values
@return string The generated SQL
Write a constant as SQL query syntax