Doctrine\DBAL\Connection::quote PHP 메소드

quote() 공개 메소드

Quotes a given input parameter.
public quote ( mixed $input, string | null $type = null ) : string
$input mixed The parameter to be quoted.
$type string | null The type of the parameter.
리턴 string The quoted parameter.
    public function quote($input, $type = null)
    {
        $this->connect();
        list($value, $bindingType) = $this->getBindingInfo($input, $type);
        return $this->_conn->quote($value, $bindingType);
    }

Usage Example

예제 #1
0
 /**
  * {@inheritDoc}
  */
 protected function doSetAll(array $values)
 {
     $this->runSQL('DELETE FROM `' . $this->tableName . '`');
     $rows = array();
     foreach ($values as $key => $value) {
         $this->runSQL('INSERT INTO ' . $this->tableName . ' (`key`, `value`) VALUES (' . $this->connection->quote($key) . ',' . $this->connection->quote(json_encode($value)) . ');');
     }
 }
All Usage Examples Of Doctrine\DBAL\Connection::quote