当前位置: 首页>>代码示例>>PHP>>正文


PHP Doctrine_Table::addGenerator方法代码示例

本文整理汇总了PHP中Doctrine_Table::addGenerator方法的典型用法代码示例。如果您正苦于以下问题:PHP Doctrine_Table::addGenerator方法的具体用法?PHP Doctrine_Table::addGenerator怎么用?PHP Doctrine_Table::addGenerator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Doctrine_Table的用法示例。


在下文中一共展示了Doctrine_Table::addGenerator方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: initialize

 /**
  * initialize
  *
  * Initialize the plugin. Call in Doctrine_Template setTableDefinition() in order to initiate a generator in a template
  * SEE: Doctrine_Template_I18n for an example
  *
  * @param  Doctrine_Table $table 
  * @return void
  */
 public function initialize(Doctrine_Table $table)
 {
     if ($this->_initialized) {
         return false;
     }
     $this->_initialized = true;
     $this->initOptions();
     $table->addGenerator($this, get_class($this));
     $this->_options['table'] = $table;
     $this->_options['className'] = str_replace('%CLASS%', $this->_options['table']->getComponentName(), $this->_options['className']);
     // check that class doesn't exist (otherwise we cannot create it)
     if ($this->_options['generateFiles'] === false && class_exists($this->_options['className'], false)) {
         return false;
     }
     $this->buildTable();
     $fk = $this->buildForeignKeys($this->_options['table']);
     $this->_table->setColumns($fk);
     $this->buildRelation();
     $this->setTableDefinition();
     $this->setUp();
     $definition = array();
     $definition['columns'] = $this->_table->getColumns();
     $definition['tableName'] = $this->_table->getTableName();
     $definition['actAs'] = $this->_table->getTemplates();
     $this->generateClass($definition);
     $this->buildChildDefinitions();
     $this->_table->initIdentifier();
 }
开发者ID:ninjapenguin,项目名称:kohana-Doctrine-module,代码行数:37,代码来源:Generator.php

示例2: initialize

 /**
  * Initialize the plugin. Call in Doctrine_Template setTableDefinition() in order to initiate a generator in a template
  *
  * @see Doctrine_Template_I18n
  * @param  Doctrine_Table $table 
  * @return void
  */
 public function initialize(Doctrine_Table $table)
 {
     if ($this->_initialized) {
         return false;
     }
     $this->_initialized = true;
     $this->initOptions();
     $table->addGenerator($this, get_class($this));
     $this->_options['table'] = $table;
     $ownerClassName = $this->_options['table']->getComponentName();
     $className = $this->_options['className'];
     $this->_options['className'] = str_replace('%CLASS%', $ownerClassName, $className);
     if (isset($this->_options['tableName'])) {
         $ownerTableName = $this->_options['table']->getTableName();
         $tableName = $this->_options['tableName'];
         $this->_options['tableName'] = str_replace('%TABLE%', $ownerTableName, $tableName);
     }
     // check that class doesn't exist (otherwise we cannot create it)
     if ($this->_options['generateFiles'] === false && class_exists($this->_options['className'])) {
         $this->_table = Doctrine_Core::getTable($this->_options['className']);
         return false;
     }
     $this->buildTable();
     $fk = $this->buildForeignKeys($this->_options['table']);
     $this->_table->setColumns($fk);
     $this->buildRelation();
     $this->setTableDefinition();
     $this->setUp();
     $this->generateClassFromTable($this->_table);
     $this->buildChildDefinitions();
     $this->_table->initIdentifier();
 }
开发者ID:densem-2013,项目名称:exikom,代码行数:39,代码来源:Generator.php

示例3: initialize

 /**
  * Initialize the plugin. Call in Doctrine_Template setTableDefinition() in order to initiate a generator in a template
  *
  * @see Doctrine_Template_I18n
  * @param  Doctrine_Table $table 
  * @return void
  */
 public function initialize(Doctrine_Table $table)
 {
     if ($this->_initialized) {
         return false;
     }
     $this->_initialized = true;
     $this->initOptions();
     $table->addGenerator($this, get_class($this));
     $this->_options['table'] = $table;
     $ownerClassName = $this->_options['table']->getComponentName();
     $className = $this->_options['className'];
     $this->_options['className'] = str_replace('%CLASS%', $ownerClassName, $className);
     if (isset($this->_options['tableName'])) {
         $ownerTableName = $this->_options['table']->getTableName();
         $tableName = $this->_options['tableName'];
         $this->_options['tableName'] = str_replace('%TABLE%', $ownerTableName, $tableName);
     }
     $currentTableHash = spl_object_hash($table);
     if (!empty(self::$initializedTables[$currentTableHash])) {
         return null;
     }
     self::$initializedTables[$currentTableHash] = true;
     $this->buildTable();
     $fk = $this->buildForeignKeys($this->_options['table']);
     $this->_table->setColumns($fk);
     $this->buildRelation();
     $this->setTableDefinition();
     $this->setUp();
     if ($this->_options['generateFiles'] === true || !class_exists($this->_options['className'])) {
         $this->generateClassFromTable($this->_table);
     }
     $this->buildChildDefinitions();
     $this->_table->initIdentifier();
 }
开发者ID:te-koyama,项目名称:openpne,代码行数:41,代码来源:Generator.php


注:本文中的Doctrine_Table::addGenerator方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。