public function balancewithdrawAction() { //$withdrawForm = new FormProcessor_Account_UserBalanceWithdraw($this->db, $this->userObject); $amount = $this->getRequest()->getParam('widthdrawAmount'); if ($this->getRequest()->isPost()) { echo 'withdrawing'; if ($amount < $this->userObject->accountBalanceSummary->available_balance) { $userAccountBalanceAndRewardPointProcessor = new AccountBalanceAndRewardPointProcessor($this->db, $this->userObject); $userAccountBalanceAndRewardPointProcessor->widthdrawBalance($amount); } else { echo 'ERROR: you do not have enough to withdraw this sum'; } } else { //not posted } $currentWithdraws = DatabaseObject_Helper_UserManager::loadUserWithdraws($this->db, $this->userObject->getId()); $this->view->currentWithdraws = $currentWithdraws; $this->view->accountBalance = $this->userObject->accountBalanceSummary; }