Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function cancelAction()
- {
- /* @var $user User */
- $user = $this->getUser();
- $unconfirmedPayout = $this->getUnconfirmedPayout();
- if ($unconfirmedPayout) {
- /* @var $payoutManager PayoutManager */
- $payoutManager = $this->get('big_music_partner.payout_manager');
- try {
- $payoutManager->cancelPayoutRequest($unconfirmedPayout, $user);
- } catch (UnexpectedPayoutStatusException $e) {
- }
- }
- return new RedirectResponse($this->generateUrl('payout_history'));
- }
- protected function getUnconfirmedPayout()
- {
- /* @var $user User */
- $user = $this->getUser();
- $unconfirmePayout = PayoutQuery::create()
- ->filterByUser($user)
- ->findOneByStatus(PayoutPeer::STATUS_UNCONFIRMED);
- return $unconfirmePayout;
- }
- /* PayoutManager*/
- public function cancelPayoutRequest(Payout $payout)
- {
- if ($payout->getStatus() !== PayoutPeer::STATUS_UNCONFIRMED) {
- throw new UnexpectedPayoutStatusException();
- }
- ..............
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement