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


PHP AbstractSchemaManager::tablesExist方法代碼示例

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


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

示例1: setName

 /**
  * @param $name
  *
  * @throws SchemaException
  */
 public function setName($name)
 {
     if (!$this->sm->tablesExist($this->prefix . $name)) {
         throw new SchemaException("Table {$name} does not exist!");
     }
     $this->table = $this->sm->listTableDetails($this->prefix . $name);
 }
開發者ID:Yame-,項目名稱:mautic,代碼行數:12,代碼來源:IndexSchemaHelper.php

示例2: createModel

 /**
  * @param Config $config
  * @return EloquentModel
  * @throws GeneratorException
  */
 public function createModel(Config $config)
 {
     $model = new EloquentModel($config->get('class_name'), $config->get('base_class_name'), $config->get('table_name'));
     if (!$this->manager->tablesExist($this->tablePrefix . $model->getTableName())) {
         throw new GeneratorException(sprintf('Table %s does not exist', $this->tablePrefix . $model->getTableName()));
     }
     $this->setNamespace($model, $config)->setCustomProperties($model, $config)->setFields($model)->setRelations($model);
     return $model;
 }
開發者ID:xvlady,項目名稱:eloquent-model-generator,代碼行數:14,代碼來源:EloquentModelBuilder.php

示例3: onSuccess

 public function onSuccess(Form $form)
 {
     if (!Callback::create($this->checkConnection)->invoke() || !$this->schemaManager->tablesExist('users')) {
         return;
     }
     $presenter = $form->presenter;
     $logEntity = new LogEntity($this->user instanceof UserEntity ? $this->user : NULL, 'Venne\\Forms\\Form', NULL, LogEntity::ACTION_OTHER);
     $logEntity->setType($presenter->link('this'));
     $logEntity->setMessage('Configuration has been updated');
     $this->logRepository->save($logEntity);
 }
開發者ID:svobodni,項目名稱:web,代碼行數:11,代碼來源:FormLogListener.php

示例4: __construct

 /**
  * constructor
  * @param string $table_name
  * @param Connection $conn
  */
 public function __construct($table_name, \Doctrine\DBAL\Connection $conn)
 {
     $this->conn = $conn;
     $this->table_name = $table_name;
     $this->quoted_table_name = $this->conn->quoteIdentifier($this->table_name);
     $this->sm = $this->conn->getSchemaManager();
     if (!$this->sm->tablesExist([$table_name])) {
         throw Schema\SchemaException::tableDoesNotExist($table_name);
     }
     foreach ($this->sm->listTableColumns($this->table_name) as $colum) {
         $this->columns[$colum->getName()] = $colum;
         $this->column_types[$colum->getName()] = $colum->getType()->getName();
     }
 }
開發者ID:schwaen,項目名稱:doctrine-dbal-extensions,代碼行數:19,代碼來源:Model.php

示例5: tableExist

 private function tableExist()
 {
     try {
         $name = $this->em->getClassMetadata('RenderBundle:Queue')->getTableName();
         return $this->sm->tablesExist($name);
     } catch (\Exception $e) {
         return false;
     }
 }
開發者ID:carloboy7,項目名稱:ownsongmovie,代碼行數:9,代碼來源:CheckCommand.php

示例6: checkTableExists

 /**
  * Determine if a table exists.
  *
  * @param string $table
  * @param bool   $throwException
  *
  * @return bool
  *
  * @throws SchemaException
  */
 public function checkTableExists($table, $throwException = false)
 {
     if ($this->sm->tablesExist($this->prefix . $table)) {
         if ($throwException) {
             throw new SchemaException($this->prefix . "{$table} already exists");
         }
         return true;
     }
     return false;
 }
開發者ID:dongilbert,項目名稱:mautic,代碼行數:20,代碼來源:TableSchemaHelper.php

示例7: checkTableExists

 /**
  * Determine if a table exists
  *
  * @param      $table
  * @param bool $throwException
  * @return bool
  */
 public function checkTableExists($table, $throwException = false)
 {
     if (!$this->sm->tablesExist($table)) {
         if ($throwException) {
             throw new SchemaUpdateException("{$table} does not exist");
         } else {
             return false;
         }
     } else {
         return true;
     }
 }
開發者ID:woakes070048,項目名稱:mautic,代碼行數:19,代碼來源:ColumnSchemaHelper.php

示例8: createTable

 /**
  * @param AbstractSchemaManager $schemaM
  * @param Schema                $schema
  *
  * @since 1.1.0
  *
  * @author Eddilbert Macharia (http://eddmash.com) <edd.cowan@gmail.com>
  */
 public function createTable($schemaM, $schema)
 {
     if ($schemaM->tablesExist('artists')) {
         $schemaM->dropTable('artists');
     }
     if ($schemaM->tablesExist('user')) {
         $schemaM->dropTable('user');
     }
     echo 'Tables :: ';
     $UTable = $schema->createTable('user');
     $UTable->addColumn('id', 'integer', ['unsigned' => true, 'autoincrement' => true]);
     $UTable->addColumn('name', 'string', ['length' => 60]);
     $UTable->setPrimaryKey(['id']);
     $myTable = $schema->createTable('artists');
     $myTable->addColumn('id', 'integer', ['unsigned' => true, 'autoincrement' => true]);
     $myTable->addColumn('user_id', 'integer', ['unsigned' => true]);
     $myTable->addColumn('name', 'string', ['length' => 60]);
     $myTable->setPrimaryKey(['id']);
     $myTable->addForeignKeyConstraint($UTable, array('user_id'), array('id'), array('onUpdate' => 'CASCADE'));
     $schemaM->createTable($UTable);
     $schemaM->createTable($myTable);
 }
開發者ID:eddmash,項目名稱:powerorm,代碼行數:30,代碼來源:Testdb.php

示例9: tablesExist

 /**
  * Returns true if all the given tables exist.
  *
  * @param  array $tables
  * @return bool
  */
 public function tablesExist($tables)
 {
     $tables = array_map([$this, 'replacePrefix'], (array) $tables);
     return $this->manager->tablesExist($tables);
 }
開發者ID:enyaku,項目名稱:myGoogleMapsApiV3Test,代碼行數:11,代碼來源:Utility.php

示例10: tableExists

 private function tableExists()
 {
     return $this->schemaManager->tablesExist(self::TABLE);
 }
開發者ID:alinnflorinn,項目名稱:CraueFormFlowBundle,代碼行數:4,代碼來源:DoctrineStorage.php


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