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


PHP SchemaConfig::setName方法代码示例

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


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

示例1: testCleanupForeignKeysDifferentOrder

 /**
  * @group DBAL-204
  */
 public function testCleanupForeignKeysDifferentOrder()
 {
     $config = new SchemaConfig();
     $config->setName("test");
     $schema = new Schema(array(), array(), $config);
     $testTable = $schema->createTable("test.test");
     $testTable->addColumn('id', 'integer');
     $fooTable = $schema->createTable("foo.bar");
     $fooTable->addColumn('id', 'integer');
     $testTable->addForeignKeyConstraint("foo.bar", array("id"), array("id"));
     $schema->visit(new RemoveNamespacedAssets());
     $sql = $schema->toSql(new MySqlPlatform());
     $this->assertEquals(1, count($sql), "Just one CREATE TABLE statement, no foreign key and table to foo.bar");
 }
开发者ID:Werelds,项目名称:FrameworkBenchmarks,代码行数:17,代码来源:RemoveNamespacedAssetsTest.php

示例2: testFqnSchemaComparisionNoSchemaSame

 /**
  * @group DBAL-204
  */
 public function testFqnSchemaComparisionNoSchemaSame()
 {
     $config = new SchemaConfig();
     $config->setName("foo");
     $oldSchema = new Schema(array(), array(), $config);
     $oldSchema->createTable('bar');
     $newSchema = new Schema();
     $newSchema->createTable('bar');
     $c = new Comparator();
     $diff = $c->compare($oldSchema, $newSchema);
     $this->assertEquals(new SchemaDiff(), $c->compare($oldSchema, $newSchema));
 }
开发者ID:llinder,项目名称:FrameworkBenchmarks,代码行数:15,代码来源:ComparatorTest.php

示例3: createSchemaConfig

 /**
  * Creates the configuration for this schema.
  *
  * @return \Doctrine\DBAL\Schema\SchemaConfig
  */
 public function createSchemaConfig()
 {
     $schemaConfig = new SchemaConfig();
     $schemaConfig->setMaxIdentifierLength($this->_platform->getMaxIdentifierLength());
     $searchPaths = $this->getSchemaSearchPaths();
     if (isset($searchPaths[0])) {
         $schemaConfig->setName($searchPaths[0]);
     }
     $params = $this->_conn->getParams();
     if (isset($params['defaultTableOptions'])) {
         $schemaConfig->setDefaultTableOptions($params['defaultTableOptions']);
     }
     return $schemaConfig;
 }
开发者ID:tamboer,项目名称:LaravelOctober,代码行数:19,代码来源:AbstractSchemaManager.php

示例4: checkTableMigrate

 /**
  * Check the migration of a table on a copy so we can detect errors before messing with the real table
  *
  * @param \Doctrine\DBAL\Schema\Table $table
  * @throws \OC\DB\MigrationException
  */
 protected function checkTableMigrate(Table $table)
 {
     $name = $table->getName();
     $tmpName = $this->generateTemporaryTableName($name);
     $this->copyTable($name, $tmpName);
     //create the migration schema for the temporary table
     $tmpTable = $this->renameTableSchema($table, $tmpName);
     $schemaConfig = new SchemaConfig();
     $schemaConfig->setName($this->connection->getDatabase());
     $schema = new Schema(array($tmpTable), array(), $schemaConfig);
     try {
         $this->applySchema($schema);
         $this->dropTable($tmpName);
     } catch (DBALException $e) {
         // pgsql needs to commit it's failed transaction before doing anything else
         if ($this->connection->isTransactionActive()) {
             $this->connection->commit();
         }
         $this->dropTable($tmpName);
         throw new MigrationException($table->getName(), $e->getMessage());
     }
 }
开发者ID:drognisep,项目名称:Portfolio-Site,代码行数:28,代码来源:Migrator.php

示例5: getSchemaConfig

	private function getSchemaConfig() {
		$config = new SchemaConfig();
		$config->setName($this->connection->getDatabase());
		return $config;
	}
开发者ID:ninjasilicon,项目名称:core,代码行数:5,代码来源:migrator.php

示例6: createSchemaConfig

 /**
  * Create the configuration for this schema.
  *
  * @return SchemaConfig
  */
 public function createSchemaConfig()
 {
     $schemaConfig = new SchemaConfig();
     $schemaConfig->setMaxIdentifierLength($this->_platform->getMaxIdentifierLength());
     $searchPaths = $this->getSchemaSearchPaths();
     if (isset($searchPaths[0])) {
         $schemaConfig->setName($searchPaths[0]);
     }
     return $schemaConfig;
 }
开发者ID:pollux1er,项目名称:dlawebdev2,代码行数:15,代码来源:AbstractSchemaManager.php

示例7: testFqnSchemaComparisionNoSchemaSame

 /**
  * @group DBAL-204
  */
 public function testFqnSchemaComparisionNoSchemaSame()
 {
     $config = new SchemaConfig();
     $config->setName("foo");
     $oldSchema = new Schema(array(), array(), $config);
     $oldSchema->createTable('bar');
     $newSchema = new Schema();
     $newSchema->createTable('bar');
     $expected = new SchemaDiff();
     $expected->fromSchema = $oldSchema;
     $this->assertEquals($expected, Comparator::compareSchemas($oldSchema, $newSchema));
 }
开发者ID:selimcr,项目名称:servigases,代码行数:15,代码来源:ComparatorTest.php


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