public function getSql()
    {
        if ($this->sql !== null && $this->state === self::STATE_CLEAN) {
            return $this->sql;
        }

        switch ($this->type) {
            case self::DELETE:
                $this->sql = $this->getSqlForDelete();
                break;

            case self::UPDATE:
                $this->sql = $this->getSqlForUpdate();
                break;

            case self::SELECT:
            default:
                $this->sql = $this->getSqlForSelect();
                break;
        }

        $this->state = self::STATE_CLEAN;

        return $this->sql;
    }
public function getSql()
    {
        if ($this->sql !== null && $this->state === self::STATE_CLEAN) {
            return $this->sql;
        }

        switch ($this->type) {
            case self::DELETE:
                $this->sql = $this->getSqlForDelete();
                break;

            case self::UPDATE:
                $this->sql = $this->getSqlForUpdate();
                break;

            case self::SELECT:
            default:
                $this->sql = $this->getSqlForSelect();
                break;
        }

        $this->state = self::STATE_CLEAN;

        return $this->sql;
    }
public function getSql ( ) { if ( $ this -> sql !== null && $ this -> state === self :: STATE_CLEAN ) { return $ this -> sql ; } switch ( $ this -> type ) { case self :: DELETE : $ this -> sql = $ this -> getSqlForDelete ( ) ; break ; case self :: UPDATE : $ this -> sql = $ this -> getSqlForUpdate ( ) ; break ; case self :: SELECT : default : $ this -> sql = $ this -> getSqlForSelect ( ) ; break ; } $ this -> state = self :: STATE_CLEAN ; return $ this -> sql ; }
Get the complete SQL string formed by the current specifications of this QueryBuilder

@return string The sql query string
Get the complete SQL string formed by the current specifications of this QueryBuilder