當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。