本文整理汇总了PHP中Column::getPeerName方法的典型用法代码示例。如果您正苦于以下问题:PHP Column::getPeerName方法的具体用法?PHP Column::getPeerName怎么用?PHP Column::getPeerName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Column
的用法示例。
在下文中一共展示了Column::getPeerName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getColumnConstant
/**
* Get the column constant name (e.g. PeerName::COLUMN_NAME).
*
* @param Column $col The column we need a name for.
* @param string $classname The Peer classname to use.
*
* @return string If $classname is provided, then will return $classname::COLUMN_NAME; if not, then the peername is looked up for current table to yield $currTablePeer::COLUMN_NAME.
*/
public function getColumnConstant($col, $classname = null)
{
if ($col === null) {
$e = new Exception("No col specified.");
print $e;
throw $e;
}
if ($classname === null) {
return $this->getBuildProperty('classPrefix') . $col->getConstantName();
}
// was it overridden in schema.xml ?
if ($col->getPeerName()) {
$const = strtoupper($col->getPeerName());
} else {
$const = strtoupper($col->getName());
}
return $classname . '::' . $const;
}
示例2: getColumnConstant
/**
* Get the column constant name (e.g. PeerName::COLUMN_NAME).
*
* @param Column $col The column we need a name for.
* @param string $phpName The PHP Name of the peer class. The 'Peer' is appended automatically.
*
* @return string If $phpName is provided, then will return {$phpName}Peer::COLUMN_NAME; if not, then uses current table COLUMN_NAME.
*/
public function getColumnConstant($col, $phpName = null)
{
if ($col === null) {
$e = new Exception("No col specified.");
print $e;
throw $e;
}
$classname = $this->getPeerClassname($phpName);
// was it overridden in schema.xml ?
if ($col->getPeerName()) {
$const = strtoupper($col->getPeerName());
} else {
$const = strtoupper($col->getName());
}
return $classname . '::' . $const;
}
示例3: getColumnName
/**
* COMPATIBILITY: Get the column constant name (e.g. PeerName::COLUMN_NAME).
*
* This method exists simply because it belonged to the 'PeerBuilder' that this
* class is replacing (because of name conflict more than actual functionality overlap).
* When the new builder model is finished this method will be removed.
*
* @param Column $col The column we need a name for.
* @param string $phpName The PHP Name of the peer class. The 'Peer' is appended automatically.
*
* @return string If $phpName is provided, then will return {$phpName}Peer::COLUMN_NAME; if not, just COLUMN_NAME.
* @deprecated
*/
public static function getColumnName(Column $col, $phpName = null)
{
// was it overridden in schema.xml ?
if ($col->getPeerName()) {
$const = strtoupper($col->getPeerName());
} else {
$const = strtoupper($col->getName());
}
if ($phpName !== null) {
return $phpName . 'Peer::' . $const;
} else {
return $const;
}
}