BxBaseModPaymentDb.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 BasePayment Base classes for Payment like modules
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxBaseModPaymentDb extends BxBaseModGeneralDb
  12. {
  13. function __construct(&$oConfig)
  14. {
  15. parent::__construct($oConfig);
  16. }
  17. public function insertModule($aData)
  18. {
  19. $sQuery = $this->prepare("INSERT IGNORE INTO `" . $this->_sPrefix . "modules`(`name`) VALUES(?)", $aData['name']);
  20. $this->query($sQuery);
  21. }
  22. public function deleteModule($aData)
  23. {
  24. $sQuery = $this->prepare("DELETE FROM `" . $this->_sPrefix . "modules` WHERE `name`=? LIMIT 1", $aData['name']);
  25. $this->query($sQuery);
  26. }
  27. public function getModules()
  28. {
  29. $sQuery = $this->prepare("SELECT
  30. `tsm`.`id` AS `id`,
  31. `tm`.`name` AS `name`,
  32. `tsm`.`title` AS `title`,
  33. `tsm`.`uri` AS `uri`
  34. FROM `" . $this->_sPrefix . "modules` AS `tm`
  35. LEFT JOIN `sys_modules` AS `tsm` ON `tm`.`name`=`tsm`.`name`
  36. ORDER BY `tsm`.`date`");
  37. return $this->getAll($sQuery);
  38. }
  39. }
  40. /** @} */