ManaPHP\Db::getEmulatedSQL PHP Method

getEmulatedSQL() public method

Active SQL statement in the object with replace the bind with value
public getEmulatedSQL ( integer $preservedStrLength ) : string
$preservedStrLength integer
return string
    public function getEmulatedSQL($preservedStrLength = -1)
    {
        if (count($this->_bind) === 0) {
            return (string) $this->_sql;
        }
        $bind = $this->_bind;
        if (isset($bind[0])) {
            return (string) $this->_sql;
        } else {
            $replaces = [];
            foreach ($bind as $key => $value) {
                $replaces[':' . $key] = $this->_parseBindValue($value, $preservedStrLength);
            }
            return (string) strtr($this->_sql, $replaces);
        }
    }