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


PHP Doctrine_Table::getFieldName方法代碼示例

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


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

示例1: _getColumns

 /**
  * Return all columns
  * @return array
  */
 protected function _getColumns()
 {
     $columns = array();
     foreach ($this->_table->getColumns() as $name => $definition) {
         if (isset($definition['primary']) && $definition['primary'] || !isset($this->_columnTypes[$definition['type']]) || in_array($name, $this->_ignoreColumns)) {
             continue;
         }
         $definition['fieldName'] = $this->_table->getFieldName($name);
         $columns[$name] = $definition;
     }
     return $columns;
 }
開發者ID:abtris,項目名稱:zfcore,代碼行數:16,代碼來源:DoctrineForm.php

示例2: getColumns

 /**
  * Return all columns as an array
  *
  * Array must contain 'type' for column type, 'notnull' true/false
  * for the column's nullability, and 'values' for enum values, 'primary'
  * true/false for primary key. Key = column's name
  *
  * @return array
  */
 public function getColumns()
 {
     $foreignKeyColumns = array();
     foreach ($this->_table->getRelations() as $alias => $relation) {
         $localColumn = strtolower($relation['local']);
         $foreignKeyColumns[$localColumn] = $relation['class'];
     }
     $data = $this->_table->getColumns();
     $cols = array();
     foreach ($data as $name => $def) {
         $isPrimary = isset($def['primary']) ? $def['primary'] : false;
         $isForeignKey = isset($foreignKeyColumns[strtolower($name)]);
         $columnName = $this->_table->getColumnName($name);
         $fieldName = $this->_table->getFieldName($columnName);
         $cols[$fieldName] = array('type' => $def['type'], 'notnull' => isset($def['notnull']) ? $def['notnull'] : false, 'values' => isset($def['values']) ? $def['values'] : array(), 'primary' => $isPrimary, 'foreignKey' => $isForeignKey, 'class' => $isForeignKey ? $foreignKeyColumns[strtolower($name)] : null);
     }
     return $cols;
 }
開發者ID:lciolecki,項目名稱:zf-doctrine,代碼行數:27,代碼來源:Doctrine.php

示例3: getFieldName

 /**
  * Get the alias/field name
  *
  * @return string $fieldName
  */
 public function getFieldName()
 {
     return $this->table->getFieldName($this->getName());
 }
開發者ID:xfifix,項目名稱:symfony-1.4,代碼行數:9,代碼來源:sfDoctrineColumn.class.php


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