BxPaymentResponse.php 995 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup Payment Payment
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxPaymentResponse extends BxDolAlertsResponse
  12. {
  13. protected $MODULE;
  14. protected $_oModule;
  15. public function __construct()
  16. {
  17. $this->MODULE = 'bx_payment';
  18. parent::__construct();
  19. $this->_oModule = BxDolModule::getInstance($this->MODULE);
  20. }
  21. /**
  22. * Overwtire the method of parent class.
  23. *
  24. * @param BxDolAlerts $oAlert an instance of alert.
  25. */
  26. public function response($oAlert)
  27. {
  28. if($oAlert->sUnit != 'profile' || !in_array($oAlert->sAction, array('join', 'delete')))
  29. return;
  30. switch($oAlert->sAction) {
  31. case 'join':
  32. $this->_oModule->onProfileJoin($oAlert->iObject);
  33. break;
  34. case 'delete':
  35. $this->_oModule->onProfileDelete($oAlert->iObject);
  36. break;
  37. }
  38. }
  39. }
  40. /** @} */