本文整理汇总了PHP中ColumnMap::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP ColumnMap::getName方法的具体用法?PHP ColumnMap::getName怎么用?PHP ColumnMap::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ColumnMap
的用法示例。
在下文中一共展示了ColumnMap::getName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Create a new instance.
*
* @param Criteria $parent The outer class (this is an "inner" class).
* @param ColumnMap $column A Column object to help escaping the value
* @param mixed $value
* @param string $comparison, among ModelCriteria::MODEL_CLAUSE
* @param string $clause A simple pseudo-SQL clause, e.g. 'foo.BAR LIKE ?'
*/
public function __construct(Criteria $outer, $column, $value = null, $comparison = ModelCriteria::MODEL_CLAUSE, $clause)
{
$this->value = $value;
if ($column instanceof ColumnMap) {
$this->column = $column->getName();
$this->table = $column->getTable()->getName();
} else {
$dotPos = strrpos($column, '.');
if ($dotPos === false) {
// no dot => aliased column
$this->table = null;
$this->column = $column;
} else {
$this->table = substr($column, 0, $dotPos);
$this->column = substr($column, $dotPos + 1, strlen($column));
}
}
$this->comparison = $comparison === null ? Criteria::EQUAL : $comparison;
$this->clause = $clause;
$this->init($outer);
}
示例2: addConfiguredColumn
/**
* Add a pre-created column to this table. It will replace any
* existing column.
*
* @param ColumnMap $cmap A ColumnMap.
*
* @return ColumnMap The added column map.
*/
public function addConfiguredColumn($cmap)
{
$this->columns[$cmap->getName()] = $cmap;
return $cmap;
}
示例3: getColumnNameAndOptions
protected function getColumnNameAndOptions(ColumnMap $column)
{
$name = strtolower($column->getName());
$relation = $column->getRelation();
$options = array('label' => $relation ? $relation->getName() : ucfirst(str_replace("_", " ", $name)), 'id' => 'table-' . str_replace('_', '-', $column->getTableName()) . '-column-' . str_replace("_", "-", $name) . rand());
return array($name, $options);
}
示例4: getColumnName
protected function getColumnName(\ColumnMap $column)
{
return strtolower($column->getName());
}
示例5: getRowValue
/**
* Gets value for row table
*
* Swaps foreign creator_node_id values for their unique FQDN value. Note that the other
* part(s) to a primary or foreign key is set by the creator and is the same in all nodes,
* so may be hashed without causing difference problems between nodes.
*
* @todo Better node table detection required (should use known prefix)
* @todo Fix column name hardwiring
*
* @param MeshingBaseObject $object
* @param ColumnMap $columnMap
* @return mixed
*/
protected function getRowValue(MeshingBaseObject $object, ColumnMap $columnMap)
{
// Get value for this column
$columnName = $columnMap->getName();
$value = $object->getByName($columnName, BasePeer::TYPE_RAW_COLNAME);
// If the related table name ends with '_known_node' then we assume this is a
// FK to a creator node ID.
if ($columnMap->isForeignKey()) {
$match = '_known_node';
$isNodeTable = $match == substr($columnMap->getRelatedTableName(), -strlen($match));
if ($isNodeTable && $columnMap->getRelatedColumnName() == 'ID') {
$nodePeerName = $columnMap->getRelation()->getForeignTable()->getPeerClassname();
$node = call_user_func(array($nodePeerName, 'retrieveByPK'), $value, $this->con);
// If there is no related node, we really do have problems!
if (!$node) {
$primaryKey = $object->getPrimaryKey();
if (is_array($primaryKey)) {
$primaryKey = '{' . implode(',', $primaryKey) . '}';
}
$type = get_class($object);
throw new Exception("Row {$primaryKey} in table '{$type}' points to a non-existent node row");
}
$value = $node->getFqdn();
}
}
return $value;
}