Piwik\Updater\Migration\Db\Sql::__toString PHP Method

__toString() public method

public __toString ( )
    public function __toString()
    {
        $sql = $this->sql;
        if (!Common::stringEndsWith($sql, ';')) {
            $sql .= ';';
        }
        return $sql;
    }

Usage Example

Exemplo n.º 1
0
 public function __toString()
 {
     $sql = parent::__toString();
     foreach ($this->bind as $value) {
         if (!is_int($value) && !is_float($value)) {
             $value = "'" . addcslashes($value, "\n\r\\'\"") . "'";
         }
         $sql = substr_replace($sql, $value, $pos = strpos($sql, '?'), $len = 1);
     }
     return $sql;
 }