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


PHP Doctrine_Import_Builder::buildDefinition方法代碼示例

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


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

示例1: generateClass

 /**
  * Generates the class definition for plugin class
  *
  * @param array $definition  Definition array defining columns, relations and options
  *                           for the model
  * @return void
  */
 public function generateClass(array $definition = array())
 {
     $definition['className'] = $this->_options['className'];
     $definition['toString'] = isset($this->_options['toString']) ? $this->_options['toString'] : false;
     if (isset($this->_options['listeners'])) {
         $definition['listeners'] = $this->_options['listeners'];
     }
     $builder = new Doctrine_Import_Builder();
     $builderOptions = isset($this->_options['builderOptions']) ? (array) $this->_options['builderOptions'] : array();
     $builder->setOptions($builderOptions);
     if ($this->_options['generateFiles']) {
         if (isset($this->_options['generatePath']) && $this->_options['generatePath']) {
             $builder->setTargetPath($this->_options['generatePath']);
             $builder->buildRecord($definition);
         } else {
             throw new Doctrine_Record_Exception('If you wish to generate files then you must specify the path to generate the files in.');
         }
     } else {
         $def = $builder->buildDefinition($definition);
         eval($def);
     }
 }
開發者ID:densem-2013,項目名稱:exikom,代碼行數:29,代碼來源:Generator.php

示例2: generateClass

 /**
  * generates the class definition for plugin class
  *
  * @param array $columns    the plugin class columns, keys representing the column names
  *                          and values as column definitions
  *
  * @param array $relations  the bound relations of the plugin class
  *
  * @param array $options    plugin class options, keys representing the option names
  *                          and values as option values
  * @return void
  */
 public function generateClass(array $columns = array(), array $relations = array(), array $options = array())
 {
     $options['className'] = $this->_options['className'];
     $builder = new Doctrine_Import_Builder();
     if ($this->_options['generateFiles']) {
         if (isset($this->_options['generatePath']) && $this->_options['generatePath']) {
             $builder->setTargetPath($this->_options['generatePath']);
             $builder->buildRecord($options, $columns, $relations);
         } else {
             throw new Doctrine_Plugin_Exception('If you wish to generate files then you must specify the path to generate the files in.');
         }
     } else {
         $def = $builder->buildDefinition($options, $columns, $relations);
         eval($def);
     }
 }
開發者ID:kirvin,項目名稱:the-nerdery,代碼行數:28,代碼來源:Plugin.php


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