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


PHP Identifier::getName方法代码示例

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


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

示例1: 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

示例2: getTableWhereClause

 /**
  * @param string $table
  * @param string $classAlias
  * @param string $namespaceAlias
  *
  * @return string
  */
 private function getTableWhereClause($table, $classAlias = 'c', $namespaceAlias = 'n')
 {
     $whereClause = $namespaceAlias . ".nspname NOT IN ('pg_catalog', 'information_schema', 'pg_toast') AND ";
     if (strpos($table, ".") !== false) {
         list($schema, $table) = explode(".", $table);
         $schema = "'" . $schema . "'";
     } else {
         $schema = "ANY(string_to_array((select replace(replace(setting,'\"\$user\"',user),' ','') from pg_catalog.pg_settings where name = 'search_path'),','))";
     }
     $table = new Identifier($table);
     $whereClause .= "{$classAlias}.relname = '" . $table->getName() . "' AND {$namespaceAlias}.nspname = {$schema}";
     return $whereClause;
 }
开发者ID:cuppyzh,项目名称:go_laundry,代码行数:20,代码来源:PostgreSqlPlatform.php

示例3: generateIdentifierName

 /**
  * Returns a hash value for a given identifier.
  *
  * @param string $identifier Identifier to generate a hash value for.
  *
  * @return string
  */
 private function generateIdentifierName($identifier)
 {
     // Always generate name for unquoted identifiers to ensure consistency.
     $identifier = new Identifier($identifier);
     return strtoupper(dechex(crc32($identifier->getName())));
 }
开发者ID:aleguisf,项目名称:fvdev1,代码行数:13,代码来源:SQLServerPlatform.php

示例4: getIdentitySequenceName

 /**
  * {@inheritdoc}
  */
 public function getIdentitySequenceName($tableName, $columnName)
 {
     $table = new Identifier($tableName);
     // No usage of column name to preserve BC compatibility with <2.5
     $identitySequenceName = $table->getName() . '_SEQ';
     if ($table->isQuoted()) {
         $identitySequenceName = '"' . $identitySequenceName . '"';
     }
     $identitySequenceIdentifier = $this->normalizeIdentifier($identitySequenceName);
     return $identitySequenceIdentifier->getQuotedName($this);
 }
开发者ID:butonic,项目名称:dbal,代码行数:14,代码来源:OraclePlatform.php

示例5: getUnqualifiedForeignTableName

 /**
  * Returns the non-schema qualified foreign table name.
  *
  * @return string
  */
 public function getUnqualifiedForeignTableName()
 {
     $parts = explode(".", $this->_foreignTableName->getName());
     return strtolower(end($parts));
 }
开发者ID:TuxCoffeeCorner,项目名称:tcc,代码行数:10,代码来源:ForeignKeyConstraint.php

示例6: getStopDatabaseSQL

 /**
  * Returns the SQL statement for stopping a running database.
  *
  * In SQL Anywhere you can start and stop databases on a
  * database server instance.
  * This is a required statement before dropping an existing database
  * as it has to be explicitly stopped before it can be dropped.
  *
  * @param string $database Name of the database to stop.
  *
  * @return string
  */
 public function getStopDatabaseSQL($database)
 {
     $database = new Identifier($database);
     return 'STOP DATABASE "' . $database->getName() . '" UNCONDITIONALLY';
 }
开发者ID:betes-curieuses-design,项目名称:ElieJosiePhotographie,代码行数:17,代码来源:SQLAnywherePlatform.php

示例7: onSchemaAlterTableChangeColumn

 public function onSchemaAlterTableChangeColumn(SchemaAlterTableChangeColumnEventArgs $args)
 {
     $columnDiff = $args->getColumnDiff();
     $column = $columnDiff->column;
     if (!$this->isSpatialColumnType($column)) {
         return;
     }
     $diff = $args->getTableDiff();
     $table = new Identifier(false !== $diff->newName ? $diff->newName : $diff->name);
     if ($columnDiff->hasChanged('type')) {
         throw new \RuntimeException('The type of a spatial column cannot be changed (Requested changing type from "' . $columnDiff->fromColumn->getType()->getName() . '" to "' . $column->getType()->getName() . '" for column "' . $column->getName() . '" in table "' . $table->getName() . '")');
     }
     if ($columnDiff->hasChanged('geometry_type')) {
         throw new \RuntimeException('The geometry_type of a spatial column cannot be changed (Requested changing type from "' . strtoupper($columnDiff->fromColumn->getCustomSchemaOption('geometry_type')) . '" to "' . strtoupper($column->getCustomSchemaOption('geometry_type')) . '" for column "' . $column->getName() . '" in table "' . $table->getName() . '")');
     }
     if ($columnDiff->hasChanged('srid')) {
         $args->addSql(sprintf("SELECT UpdateGeometrySRID('%s', '%s', %d)", $table->getName(), $column->getName(), $column->getCustomSchemaOption('srid')));
     }
 }
开发者ID:novikovsergey,项目名称:doctrine-postgis,代码行数:19,代码来源:DBALSchemaEventSubscriber.php


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