本文整理匯總了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;
}