Differences

This shows you the differences between two versions of the page.

Link to this comparison view

getaccountsbytype [2013/01/21 12:44] (current)
Line 1: Line 1:
 +====== Get All Accounts of a Certain Type ======
  
 +===== Usage =====
 +
 +
 +==== Examples ====
 +
 +
 + $Accounts = $QB->getAccountsByType("OtherCurrentAsset");
 +
 + foreach($Accounts as $Account)
 + echo $Account->TotalBalance."<br />";
 +
 +==== Parameters ====
 +
 +  * $type  -- The type of accounts to retrieve. Must be exact match.
 +
 +
 +==== Returns ====
 +
 +  * FALSE if no accounts were found.
 +
 +  * Otherwise returns an array of Database Objects.
 +
 +
 +
 +
 +===== Source =====
 +
 + public function getAccountsByType($type)
 + {
 + $this->DB->query("SELECT * FROM qb_account WHERE AccountType = '".$this->DB->prep($type)."';");
 + return $this->DB->allToObjects();
 + }
getaccountsbytype.txt · Last modified: 2013/01/21 12:44 (external edit)