SQLBuilder\Driver\BaseDriver::quoteColumn PHP Метод

quoteColumn() публичный Метод

column quote can be configured by 'quote_column' option.
public quoteColumn ( string $name ) : string
$name string column name
Результат string column name with/without quotes.
    public function quoteColumn($name)
    {
        // TODO: quote for DB.TABLE.COLNAME
        if ($this->quoteColumn) {
            if (preg_match('/\\W/', $name)) {
                return $name;
            }
            return $this->quoteIdentifier($name);
        }
        return $name;
    }

Usage Example

Пример #1
0
 public function buildSetClause(BaseDriver $driver, ArgumentArray $args)
 {
     $setClauses = array();
     foreach ($this->sets as $col => $val) {
         $setClauses[] = $driver->quoteColumn($col) . " = " . $driver->deflate($val);
     }
     return ' SET ' . join(', ', $setClauses);
 }