当前位置: 首页>>代码示例>>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;未经允许,请勿转载。