SQLBuilder\Driver\BaseDriver::quoteColumn PHP Méthode

quoteColumn() public méthode

column quote can be configured by 'quote_column' option.
public quoteColumn ( string $name ) : string
$name string column name
Résultat 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

Exemple #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);
 }