当前位置: 首页>>代码示例>>PHP>>正文


PHP Column::getQuotedName方法代码示例

本文整理汇总了PHP中Doctrine\DBAL\Schema\Column::getQuotedName方法的典型用法代码示例。如果您正苦于以下问题:PHP Column::getQuotedName方法的具体用法?PHP Column::getQuotedName怎么用?PHP Column::getQuotedName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Doctrine\DBAL\Schema\Column的用法示例。


在下文中一共展示了Column::getQuotedName方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testQuotedColumnName

 /**
  * @group DBAL-64
  */
 public function testQuotedColumnName()
 {
     $string = Type::getType('string');
     $column = new Column("`bar`", $string, array());
     $mysqlPlatform = new \Doctrine\DBAL\Platforms\MySqlPlatform();
     $sqlitePlatform = new \Doctrine\DBAL\Platforms\SqlitePlatform();
     $this->assertEquals('bar', $column->getName());
     $this->assertEquals('`bar`', $column->getQuotedName($mysqlPlatform));
     $this->assertEquals('"bar"', $column->getQuotedName($sqlitePlatform));
 }
开发者ID:dracony,项目名称:forked-php-orm-benchmark,代码行数:13,代码来源:ColumnTest.php

示例2: getSql

 public function getSql(Column $column, $table)
 {
     if (!$table instanceof Table) {
         $table = new Identifier($table);
     }
     $sql = array();
     $normalized = $column->getType()->getNormalizedPostGISColumnOptions($column->getCustomSchemaOptions());
     $srid = $normalized['srid'];
     // PostGIS 1.5 uses -1 for undefined SRID's
     if ($srid <= 0) {
         $srid = -1;
     }
     $type = strtoupper($normalized['geometry_type']);
     if ('ZM' === substr($type, -2)) {
         $dimension = 4;
         $type = substr($type, 0, -2);
     } elseif ('M' === substr($type, -1)) {
         $dimension = 3;
     } elseif ('Z' === substr($type, -1)) {
         $dimension = 3;
         $type = substr($type, 0, -1);
     } else {
         $dimension = 2;
     }
     // Geometry columns are created by the AddGeometryColumn stored procedure
     $sql[] = sprintf("SELECT AddGeometryColumn('%s', '%s', %d, '%s', %d)", $table->getName(), $column->getName(), $srid, $type, $dimension);
     if ($column->getNotnull()) {
         // Add a NOT NULL constraint to the field
         $sql[] = sprintf('ALTER TABLE %s ALTER %s SET NOT NULL', $table->getQuotedName($this->platform), $column->getQuotedName($this->platform));
     }
     return $sql;
 }
开发者ID:novikovsergey,项目名称:doctrine-postgis,代码行数:32,代码来源:SpatialColumnSqlGenerator.php

示例3: getAlterTableRenameColumnClause

 /**
  * Returns the SQL clause for renaming a column in a table alteration.
  *
  * @param string $oldColumnName The quoted name of the column to rename.
  * @param Column $column        The column to rename to.
  *
  * @return string
  */
 protected function getAlterTableRenameColumnClause($oldColumnName, Column $column)
 {
     $oldColumnName = new Identifier($oldColumnName);
     return 'RENAME ' . $oldColumnName->getQuotedName($this) . ' TO ' . $column->getQuotedName($this);
 }
开发者ID:Kevin-ZK,项目名称:vaneDisk,代码行数:13,代码来源:SQLAnywherePlatform.php

示例4: getAlterTableAddDefaultConstraintClause

 /**
  * Returns the SQL clause for adding a default constraint in an ALTER TABLE statement.
  *
  * @param  string $tableName The name of the table to generate the clause for.
  * @param  Column $column    The column to generate the clause for.
  *
  * @return string
  */
 private function getAlterTableAddDefaultConstraintClause($tableName, Column $column)
 {
     $columnDef = $column->toArray();
     $columnDef['name'] = $column->getQuotedName($this);
     return 'ADD' . $this->getDefaultConstraintDeclarationSQL($tableName, $columnDef);
 }
开发者ID:aleguisf,项目名称:fvdev1,代码行数:14,代码来源:SQLServerPlatform.php

示例5: getAlterTableRenameColumnClause

 /**
  * Returns the SQL clause for renaming a column in a table alteration.
  *
  * @param string $oldColumnName The quoted name of the column to rename.
  * @param Column $column        The column to rename to.
  *
  * @return string
  */
 protected function getAlterTableRenameColumnClause($oldColumnName, Column $column)
 {
     return 'RENAME ' . $oldColumnName . ' TO ' . $column->getQuotedName($this);
 }
开发者ID:kierkegaard13,项目名称:graph-generator,代码行数:12,代码来源:SQLAnywherePlatform.php

示例6: prepareColumnData

 /**
  * @param \Doctrine\DBAL\Schema\Column $column The name of the table.
  * @param array $primaries
  *
  * @return array The column data as associative array.
  */
 public function prepareColumnData($column, $primaries = array())
 {
     $columnData = array();
     $columnData['name'] = $column->getQuotedName($this);
     $columnData['type'] = $column->getType();
     $columnData['length'] = $column->getLength();
     $columnData['notnull'] = $column->getNotNull();
     $columnData['fixed'] = $column->getFixed();
     $columnData['unique'] = false;
     // TODO: what do we do about this?
     $columnData['version'] = $column->hasPlatformOption("version") ? $column->getPlatformOption('version') : false;
     if (strtolower($columnData['type']) == "string" && $columnData['length'] === null) {
         $columnData['length'] = 255;
     }
     $columnData['unsigned'] = $column->getUnsigned();
     $columnData['precision'] = $column->getPrecision();
     $columnData['scale'] = $column->getScale();
     $columnData['default'] = $column->getDefault();
     $columnData['columnDefinition'] = $column->getColumnDefinition();
     $columnData['autoincrement'] = $column->getAutoincrement();
     $columnData['comment'] = $this->getColumnComment($column);
     $columnData['platformOptions'] = $column->getPlatformOptions();
     if (in_array($column->getName(), $primaries)) {
         $columnData['primary'] = true;
     }
     return $columnData;
 }
开发者ID:crate,项目名称:crate-dbal,代码行数:33,代码来源:CratePlatform.php

示例7: getRenameColumnSQL

 /**
  * Gets the SQL to rename a column.
  *
  * @param string table that contains the column
  * @param string old column name
  * @param Column new column
  */
 protected function getRenameColumnSQL($tableName, $oldName, Column $column)
 {
     return 'RENAME COLUMN ' . $tableName . '.' . $oldName . ' TO ' . $column->getQuotedName($this);
 }
开发者ID:josemalonsom,项目名称:ifx4dd,代码行数:11,代码来源:InformixPlatform.php


注:本文中的Doctrine\DBAL\Schema\Column::getQuotedName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。