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


PHP AbstractSchemaManager::createSchemaConfig方法代碼示例

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


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

示例1: getTestTable

 protected function getTestTable($name, $options=array())
 {
     $table = new \Doctrine\DBAL\Schema\Table($name, array(), array(), array(), false, $options);
     $table->setSchemaConfig($this->_sm->createSchemaConfig());
     $table->addColumn('id', 'integer', array('notnull' => true));
     $table->setPrimaryKey(array('id'));
     $table->addColumn('test', 'string', array('length' => 255));
     $table->addColumn('foreign_key_test', 'integer');
     return $table;
 }
開發者ID:pmjones,項目名稱:php-framework-benchmarks,代碼行數:10,代碼來源:SchemaManagerFunctionalTestCase.php

示例2: getTestCompositeTable

 protected function getTestCompositeTable($name)
 {
     $table = new Table($name, array(), array(), array(), false, array());
     $table->setSchemaConfig($this->_sm->createSchemaConfig());
     $table->addColumn('id', 'integer', array('notnull' => true));
     $table->addColumn('other_id', 'integer', array('notnull' => true));
     $table->setPrimaryKey(array('id', 'other_id'));
     $table->addColumn('test', 'string', array('length' => 255));
     return $table;
 }
開發者ID:selimcr,項目名稱:servigases,代碼行數:10,代碼來源:SchemaManagerFunctionalTestCase.php

示例3: executeChanges

 /**
  * Executes the changes.
  */
 public function executeChanges()
 {
     $platform = $this->db->getDatabasePlatform();
     if (!empty($this->dropTables)) {
         foreach ($this->dropTables as $t) {
             $this->sm->dropTable($this->prefix . $t);
         }
     }
     $sql = $this->schema->toSql($platform);
     if (!empty($sql)) {
         foreach ($sql as $s) {
             $this->db->executeUpdate($s);
         }
     }
     //reset schema
     $this->schema = new Schema([], [], $this->sm->createSchemaConfig());
     $this->dropTables = $this->addTables = [];
 }
開發者ID:dongilbert,項目名稱:mautic,代碼行數:21,代碼來源:TableSchemaHelper.php

示例4: getSchemaFromMetadata

 /**
  * Create schema instance from metadata
  *
  * @param array $metadata
  * @return \Doctrine\DBAL\Schema\Schema
  */
 public function getSchemaFromMetadata(array $metadata)
 {
     $entityMetadataSchemaConfig = $this->schemaManager->createSchemaConfig();
     $schema = new Schema([], [], $entityMetadataSchemaConfig);
     $pivotTables = [];
     foreach ($metadata as $entityMetadata) {
         $this->generateTableFromMetadata($schema, $entityMetadata['table']);
         // create version table
         if (!empty($entityMetadata['versionTable'])) {
             $this->generateTableFromMetadata($schema, $entityMetadata['versionTable']);
         }
         foreach ($entityMetadata['relations'] as $relationMetadata) {
             if (!empty($relationMetadata['pivotTable'])) {
                 // create pivot table for many to many relations
                 if (!in_array($relationMetadata['pivotTable']['name'], $pivotTables)) {
                     $this->generateTableFromMetadata($schema, $relationMetadata['pivotTable']);
                 }
                 $pivotTables[] = $relationMetadata['pivotTable']['name'];
             }
         }
     }
     return $schema;
 }
開發者ID:proai,項目名稱:laravel-datamapper,代碼行數:29,代碼來源:Builder.php


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