本文整理汇总了PHP中QDatabaseResultBase类的典型用法代码示例。如果您正苦于以下问题:PHP QDatabaseResultBase类的具体用法?PHP QDatabaseResultBase怎么用?PHP QDatabaseResultBase使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QDatabaseResultBase类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: InstantiateDbResult
/**
* Instantiate an array of Items from a Database Result
* @param DatabaseResultBase $objDbResult
* @return Item[]
*/
public static function InstantiateDbResult(QDatabaseResultBase $objDbResult)
{
$objToReturn = array();
// If blank resultset, then return empty array
if (!$objDbResult) {
return $objToReturn;
}
// Load up the return array with each row
while ($objDbRow = $objDbResult->GetNextRow()) {
array_push($objToReturn, Item::InstantiateDbRow($objDbRow));
}
return $objToReturn;
}
示例2: InstantiateDbResult
/**
* Instantiate an array of Librarydetailses from a Database Result
* @param DatabaseResultBase $objDbResult
* @param string $strExpandAsArrayNodes
* @param string[] $strColumnAliasArray
* @return Librarydetails[]
*/
public static function InstantiateDbResult(QDatabaseResultBase $objDbResult, $strExpandAsArrayNodes = null, $strColumnAliasArray = null)
{
$objToReturn = array();
if (!$strColumnAliasArray) {
$strColumnAliasArray = array();
}
// If blank resultset, then return empty array
if (!$objDbResult) {
return $objToReturn;
}
// Load up the return array with each row
if ($strExpandAsArrayNodes) {
$objToReturn = array();
while ($objDbRow = $objDbResult->GetNextRow()) {
$objItem = Librarydetails::InstantiateDbRow($objDbRow, null, $strExpandAsArrayNodes, $objToReturn, $strColumnAliasArray);
if ($objItem) {
$objToReturn[] = $objItem;
}
}
} else {
while ($objDbRow = $objDbResult->GetNextRow()) {
$objToReturn[] = Librarydetails::InstantiateDbRow($objDbRow, null, null, null, $strColumnAliasArray);
}
}
return $objToReturn;
}
示例3: InstantiateCursor
/**
* Instantiate a single SignupPayment object from a query cursor (e.g. a DB ResultSet).
* Cursor is automatically moved to the "next row" of the result set.
* Will return NULL if no cursor or if the cursor has no more rows in the resultset.
* @param QDatabaseResultBase $objDbResult cursor resource
* @return SignupPayment next row resulting from the query
*/
public static function InstantiateCursor(QDatabaseResultBase $objDbResult)
{
// If blank resultset, then return empty result
if (!$objDbResult) {
return null;
}
// If empty resultset, then return empty result
$objDbRow = $objDbResult->GetNextRow();
if (!$objDbRow) {
return null;
}
// We need the Column Aliases
$strColumnAliasArray = $objDbResult->QueryBuilder->ColumnAliasArray;
if (!$strColumnAliasArray) {
$strColumnAliasArray = array();
}
// Pull Expansions (if applicable)
$strExpandAsArrayNodes = $objDbResult->QueryBuilder->ExpandAsArrayNodes;
// Load up the return result with a row and return it
return SignupPayment::InstantiateDbRow($objDbRow, null, $strExpandAsArrayNodes, null, $strColumnAliasArray);
}
示例4: InstantiateDbResult
/**
* Instantiate an array of InventoryModels from a Database Result
* @param DatabaseResultBase $objDbResult
* @return InventoryModel[]
*/
public static function InstantiateDbResult(QDatabaseResultBase $objDbResult, $strExpandAsArrayNodes = null)
{
$objToReturn = array();
// If blank resultset, then return empty array
if (!$objDbResult) {
return $objToReturn;
}
// Load up the return array with each row
if ($strExpandAsArrayNodes) {
$objLastRowItem = null;
while ($objDbRow = $objDbResult->GetNextRow()) {
$objItem = InventoryModel::InstantiateDbRow($objDbRow, null, $strExpandAsArrayNodes, $objLastRowItem);
if ($objItem) {
array_push($objToReturn, $objItem);
$objLastRowItem = $objItem;
}
}
} else {
while ($objDbRow = $objDbResult->GetNextRow()) {
array_push($objToReturn, InventoryModel::InstantiateDbRow($objDbRow));
}
}
return $objToReturn;
}