BxShopifyDb.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 Shopify Shopify
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. /*
  12. * Module database queries
  13. */
  14. class BxShopifyDb extends BxBaseModTextDb
  15. {
  16. function __construct(&$oConfig)
  17. {
  18. parent::__construct($oConfig);
  19. }
  20. public function getSettings($aParams = array())
  21. {
  22. $CNF = &$this->_oConfig->CNF;
  23. $aMethod = array('name' => 'getAll', 'params' => array(0 => 'query'));
  24. $sWhereClause = $sOrderByClause = "";
  25. $sSelectClause = "*";
  26. switch($aParams['type']) {
  27. case 'id':
  28. $aMethod['name'] = 'getRow';
  29. $aMethod['params'][1] = array(
  30. 'id' => $aParams['id']
  31. );
  32. $sWhereClause .= " AND `id`=:id";
  33. break;
  34. case 'author':
  35. $aMethod['name'] = 'getRow';
  36. $aMethod['params'][1] = array(
  37. 'author' => $aParams['author']
  38. );
  39. $sWhereClause .= " AND `author`=:author";
  40. break;
  41. case 'all':
  42. break;
  43. }
  44. $aMethod['params'][0] = "SELECT " . $sSelectClause . " FROM `" . $CNF['TABLE_SETTINGS'] . "` WHERE 1 " . $sWhereClause;
  45. return call_user_func_array(array($this, $aMethod['name']), $aMethod['params']);
  46. }
  47. }
  48. /** @} */