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