protected function getDemoAccountTree()
 {
     $oAccountTree = new AccountTree([['id' => 2, 'parent' => 1, 'account_number' => '1001', 'balance' => 5.0, 'account_name' => 'Demo A', 'account_name_slug' => 'demo_a', 'hide_ui' => false, 'is_debit' => true, 'is_credit' => false], ['id' => 3, 'parent' => 1, 'account_number' => '1002', 'balance' => -5.0, 'account_name' => 'Demo B', 'account_name_slug' => 'demo_b', 'hide_ui' => false, 'is_debit' => false, 'is_credit' => true]], ['rootid' => 1]);
     $oAccountTree->calculateCombinedBalances();
     return $oAccountTree;
 }
 /**
  * Call the calculate method on the account tree
  * 
  * Catch any tree exceptions and wrap them into ledger exceptions
  * 
  * @param AccountTree $oAccountTree
  * @access protected
  * @throws LedgerException
  */
 protected function calculateParentBalances(AccountTree $oAccountTree)
 {
     try {
         $oAccountTree->calculateCombinedBalances();
     } catch (\Exception $e) {
         if ($e instanceof LedgerException) {
             throw $e;
         }
         throw new LedgerException($e->getMessage(), 0, $e);
     }
 }