當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Schema\SchemaConfig類代碼示例

本文整理匯總了PHP中Doctrine\DBAL\Schema\SchemaConfig的典型用法代碼示例。如果您正苦於以下問題:PHP SchemaConfig類的具體用法?PHP SchemaConfig怎麽用?PHP SchemaConfig使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了SchemaConfig類的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * @param \OCP\IConfig $config
  * @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform
  */
 public function __construct(IConfig $config, AbstractPlatform $platform)
 {
     $this->platform = $platform;
     $this->DBNAME = $config->getSystemValue('dbname', 'owncloud');
     $this->DBTABLEPREFIX = $config->getSystemValue('dbtableprefix', 'oc_');
     // Oracle does not support longer index names then 30 characters.
     // We use this limit for all DBs to make sure it does not cause a
     // problem.
     $this->schemaConfig = new SchemaConfig();
     $this->schemaConfig->setMaxIdentifierLength(30);
 }
開發者ID:GitHubUser4234,項目名稱:core,代碼行數:15,代碼來源:MDB2SchemaReader.php

示例2: __construct

 /**
  * @param \Doctrine\DBAL\Schema\Table[]      $tables
  * @param \Doctrine\DBAL\Schema\Sequence[]   $sequences
  * @param \Doctrine\DBAL\Schema\SchemaConfig $schemaConfig
  */
 public function __construct(array $tables = array(), array $sequences = array(), SchemaConfig $schemaConfig = null)
 {
     if ($schemaConfig == null) {
         $schemaConfig = new SchemaConfig();
     }
     $this->_schemaConfig = $schemaConfig;
     $this->_setName($schemaConfig->getName() ?: 'public');
     foreach ($tables as $table) {
         $this->_addTable($table);
     }
     foreach ($sequences as $sequence) {
         $this->_addSequence($sequence);
     }
 }
開發者ID:neteasy-work,項目名稱:hkgbf_crm,代碼行數:19,代碼來源:Schema.php

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

示例4: _getMaxIdentifierLength

 /**
  * @return int
  */
 protected function _getMaxIdentifierLength()
 {
     if ($this->_schemaConfig instanceof SchemaConfig) {
         return $this->_schemaConfig->getMaxIdentifierLength();
     } else {
         return 63;
     }
 }
開發者ID:michaelnavarro,項目名稱:zc,代碼行數:11,代碼來源:Table.php

示例5: createSchemaConfig

 /**
  * Create the configuration for this schema.
  *
  * @return SchemaConfig
  */
 public function createSchemaConfig()
 {
     $schemaConfig = new SchemaConfig();
     $schemaConfig->setMaxIdentifierLength($this->_platform->getMaxIdentifierLength());
     return $schemaConfig;
 }
開發者ID:jff15,項目名稱:travelbot,代碼行數:11,代碼來源:AbstractSchemaManager.php

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

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

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

示例9: getSchemaConfig

	private function getSchemaConfig() {
		$config = new SchemaConfig();
		$config->setName($this->connection->getDatabase());
		return $config;
	}
開發者ID:ninjasilicon,項目名稱:core,代碼行數:5,代碼來源:migrator.php

示例10: createSchemaConfig

 /**
  * Create the configuration for this schema.
  *
  * @return SchemaConfig
  */
 public function createSchemaConfig()
 {
     $schemaConfig = new SchemaConfig();
     $schemaConfig->setExplicitForeignKeyIndexes($this->_platform->createsExplicitIndexForForeignKeys());
     $schemaConfig->setMaxIdentifierLength($this->_platform->getMaxIdentifierLength());
     return $schemaConfig;
 }
開發者ID:jacques-sounvi,項目名稱:addressbook,代碼行數:12,代碼來源:AbstractSchemaManager.php

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

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

示例13: createTable

 /**
  * Creates a new table.
  *
  * @param string $tableName
  *
  * @return \Doctrine\DBAL\Schema\Table
  */
 public function createTable($tableName)
 {
     $table = new Table($tableName);
     $this->_addTable($table);
     foreach ($this->_schemaConfig->getDefaultTableOptions() as $name => $value) {
         $table->addOption($name, $value);
     }
     return $table;
 }
開發者ID:neteasy-work,項目名稱:hkgbf_crm,代碼行數:16,代碼來源:Schema.php

示例14: hasExplicitForeignKeyIndexes

 /**
  * @return bool
  */
 public function hasExplicitForeignKeyIndexes()
 {
     return $this->_schemaConfig->hasExplicitForeignKeyIndexes();
 }
開發者ID:ncud,項目名稱:sagalaya,代碼行數:7,代碼來源:Schema.php


注:本文中的Doctrine\DBAL\Schema\SchemaConfig類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。