本文整理汇总了PHP中QDatabaseRowBase::ColumnExists方法的典型用法代码示例。如果您正苦于以下问题:PHP QDatabaseRowBase::ColumnExists方法的具体用法?PHP QDatabaseRowBase::ColumnExists怎么用?PHP QDatabaseRowBase::ColumnExists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDatabaseRowBase
的用法示例。
在下文中一共展示了QDatabaseRowBase::ColumnExists方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: InstantiateDbRow
/**
* Instantiate a Forum from a Database Row.
* Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
* is calling this Forum::InstantiateDbRow in order to perform
* early binding on referenced objects.
* @param QDatabaseRowBase $objDbRow
* @param string $strAliasPrefix
* @param string $strExpandAsArrayNodes
* @param QBaseClass $objPreviousItem
* @param string[] $strColumnAliasArray
* @return Forum
*/
public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $objPreviousItem = null, $strColumnAliasArray = array())
{
// If blank row, return null
if (!$objDbRow) {
return null;
}
// Create a new instance of the Forum object
$objToReturn = new Forum();
$objToReturn->__blnRestored = true;
$strAliasName = array_key_exists($strAliasPrefix . 'id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'id'] : $strAliasPrefix . 'id';
$objToReturn->intId = $objDbRow->GetColumn($strAliasName, 'Integer');
$strAliasName = array_key_exists($strAliasPrefix . 'order_number', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'order_number'] : $strAliasPrefix . 'order_number';
$objToReturn->intOrderNumber = $objDbRow->GetColumn($strAliasName, 'Integer');
$strAliasName = array_key_exists($strAliasPrefix . 'name', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'name'] : $strAliasPrefix . 'name';
$objToReturn->strName = $objDbRow->GetColumn($strAliasName, 'VarChar');
$strAliasName = array_key_exists($strAliasPrefix . 'announce_only_flag', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'announce_only_flag'] : $strAliasPrefix . 'announce_only_flag';
$objToReturn->blnAnnounceOnlyFlag = $objDbRow->GetColumn($strAliasName, 'Bit');
$strAliasName = array_key_exists($strAliasPrefix . 'description', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'description'] : $strAliasPrefix . 'description';
$objToReturn->strDescription = $objDbRow->GetColumn($strAliasName, 'VarChar');
// Instantiate Virtual Attributes
foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
$strVirtualPrefix = $strAliasPrefix . '__';
$strVirtualPrefixLength = strlen($strVirtualPrefix);
if (substr($strColumnName, 0, $strVirtualPrefixLength) == $strVirtualPrefix) {
$objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
}
}
// Prepare to Check for Early/Virtual Binding
if (!$strAliasPrefix) {
$strAliasPrefix = 'forum__';
}
// Check for TopicLink Unique ReverseReference Binding
$strAlias = $strAliasPrefix . 'topiclink__id';
$strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
if ($objDbRow->ColumnExists($strAliasName)) {
if (!is_null($objDbRow->GetColumn($strAliasName))) {
$objToReturn->objTopicLink = TopicLink::InstantiateDbRow($objDbRow, $strAliasPrefix . 'topiclink__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
} else {
// We ATTEMPTED to do an Early Bind but the Object Doesn't Exist
// Let's set to FALSE so that the object knows not to try and re-query again
$objToReturn->objTopicLink = false;
}
}
return $objToReturn;
}