本文整理汇总了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;
}
示例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;
}
示例3: getFieldName
/**
* Get the alias/field name
*
* @return string $fieldName
*/
public function getFieldName()
{
return $this->table->getFieldName($this->getName());
}