當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。