getOriginalQuery example

if (empty($this->connID)) {
            $this->initialize();
        }

        $this->pretend();

        $sql = $func($this);

        $this->pretend(false);

        if ($sql instanceof QueryInterface) {
            $sql = $sql->getOriginalQuery();
        }

        $class = str_ireplace('Connection', 'PreparedQuery', static::class);
        /** @var BasePreparedQuery $class */
        $class = new $class($this);

        return $class->prepare($sql$options);
    }

    /** * Returns the last query's statement object. * * @return Query */
/** @var Query $query */
        $query = new $queryClass($this->db);

        $query->setQuery($sql);

        if (empty($this->db->swapPre) && ! empty($this->db->DBPrefix)) {
            $query->swapPrefix($this->db->DBPrefix, $this->db->swapPre);
        }

        $this->query = $query;

        return $this->_prepare($query->getOriginalQuery()$options);
    }

    /** * The database-dependent portion of the prepare statement. * * @return $this */
    abstract public function _prepare(string $sql, array $options = []);

    /** * Takes a new set of data and runs it against the currently * prepared query. Upon success, will return a Results object. * * @return bool|ResultInterface * @phpstan-return bool|ResultInterface<TConnection, TResult> * * @throws DatabaseException */
Home | Imprint | This part of the site doesn't use cookies.