quoteSimpleColumnName() public method

A simple column name should contain the column name only without any prefix. If the column name is already quoted or is the asterisk character '*', this method will do nothing.
public quoteSimpleColumnName ( string $name ) : string
$name string column name
return string the properly quoted column name
 /**
  * @param string $alias
  * @param string|array $columns
  * @param \yii\db\Schema $schema
  * @return string
  */
 protected function quoteColumn($alias, $columns, $schema)
 {
     $t = $schema->quoteSimpleTableName($alias);
     if (!is_array($columns)) {
         return $t . '.' . $schema->quoteSimpleColumnName($columns);
     }
     $result = array();
     foreach ($columns as $column) {
         $result[] = $t . '.' . $schema->quoteSimpleColumnName($column);
     }
     return implode(',', $result);
 }
Example #2
0
 public function quoteSimpleColumnName($name)
 {
     if (in_array(strtoupper($name), $this->reservedWords)) {
         return parent::quoteSimpleColumnName($name);
     }
     return $name;
 }