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


PHP Doctrine_Core::generateSqlFromModels方法代碼示例

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


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

示例1: execute

 public function execute()
 {
     if (is_dir($this->getArgument('sql_path'))) {
         $path = $this->getArgument('sql_path') . DIRECTORY_SEPARATOR . 'schema.sql';
     } else {
         if (is_file($this->getArgument('sql_path'))) {
             $path = $this->getArgument('sql_path');
         } else {
             throw new Doctrine_Task_Exception('Invalid sql path.');
         }
     }
     $sql = Doctrine_Core::generateSqlFromModels($this->getArgument('models_path'));
     file_put_contents($path, $sql);
     $this->notify('Generated SQL successfully for models');
 }
開發者ID:densem-2013,項目名稱:exikom,代碼行數:15,代碼來源:GenerateSql.php

示例2: action_admin_models2sql

 /**
  * model2sql
  * This generates Sql From Models.
  *
  * @see Doctrine_Core::generateSqlFromModels()
  */
 public function action_admin_models2sql()
 {
     $sql = Doctrine_Core::generateSqlFromModels();
     $sqlSchemaFile = DOCTRINE_SQL_PATH . DIRECTORY_SEPARATOR . DB_PREFIX . '_sqlschema_backup_' . date('dmY_His') . '.sql';
     file_put_contents($sqlSchemaFile, $sql);
     $message = 'Successfully written SQL for the current schema to disc.';
     $message .= 'Destination File: ' . $sqlSchemaFile;
     unset($sql);
     unset($sqlSchemaFile);
     $this->setFlashmessage('success', $message);
     $this->redirectToReferer();
 }
開發者ID:Clansuite,項目名稱:Clansuite,代碼行數:18,代碼來源:DoctrineAdminController.php

示例3: generateSql

 public function generateSql()
 {
     $this->_loadDoctrineModels();
     $sqlDir = $this->_getSqlDirectoryPath();
     $sql = Doctrine_Core::generateSqlFromModels();
     $sqlSchemaFile = $sqlDir . DIRECTORY_SEPARATOR . "schema_" . date('Ymd_His') . ".sql";
     file_put_contents($sqlSchemaFile, $sql);
     $this->_print('Successfully written SQL for the current schema to disc.', array('color' => 'green'));
     $this->_print('Destination File: ' . $sqlSchemaFile);
 }
開發者ID:nabdoulm,項目名稱:zf-doctrine,代碼行數:10,代碼來源:DoctrineProvider.php


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