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

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

column quote can be configured by 'quote_table' option.
public quoteTable ( string $name ) : string
$name string table name
Результат string table name with/without quotes.
    public function quoteTable($name)
    {
        if ($this->quoteTable) {
            // TODO: Split DB.Table
            return $this->quoteIdentifier($name);
        }
        return $name;
    }

Usage Example

Пример #1
0
 public function toSql(BaseDriver $driver, ArgumentArray $args)
 {
     $sql = 'INSERT';
     if (!empty($this->options)) {
         $sql .= $this->buildOptionClause();
     }
     $sql .= ' INTO ' . $driver->quoteTable($this->intoTable);
     // append partition clause if needed.
     $sql .= $this->buildPartitionClause($driver, $args);
     $valuesClauses = array();
     $varCnt = 1;
     // build columns
     $columns = $this->getColumnNames($driver);
     foreach ($this->values as $values) {
         $deflatedValues = array();
         foreach ($values as $key => $value) {
             $deflatedValues[] = $driver->deflate($value, $args);
         }
         $valuesClauses[] = '(' . join(',', $deflatedValues) . ')';
     }
     $sql .= ' (' . join(',', $columns) . ')' . ' VALUES ' . join(', ', $valuesClauses);
     // Check if RETURNING is supported
     if ($this->returning && $driver instanceof PgSQLDriver) {
         $sql .= ' RETURNING ' . join(',', $driver->quoteColumns($this->returning));
     }
     return $sql;
 }
All Usage Examples Of SQLBuilder\Driver\BaseDriver::quoteTable