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