BxDolCategories.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 UnaCore UNA Core
  7. * @{
  8. */
  9. class BxDolCategories extends BxDolFactory implements iBxDolSingleton
  10. {
  11. protected $_oDb;
  12. protected function __construct()
  13. {
  14. parent::__construct();
  15. $this->_oDb = new BxDolCategoriesQuery();
  16. }
  17. public function __clone()
  18. {
  19. if (isset($GLOBALS['bxDolClasses'][get_class($this)]))
  20. trigger_error('Clone is not allowed for the class: ' . get_class($this), E_USER_ERROR);
  21. }
  22. public static function getInstance()
  23. {
  24. if(!isset($GLOBALS['bxDolClasses'][__CLASS__]))
  25. $GLOBALS['bxDolClasses'][__CLASS__] = new BxDolCategories();
  26. return $GLOBALS['bxDolClasses'][__CLASS__];
  27. }
  28. public function getData($aParams = array())
  29. {
  30. return $this->_oDb->getData($aParams);
  31. }
  32. public function delete($sModule, $iObject)
  33. {
  34. return $this->_oDb->delete($sModule, $iObject);
  35. }
  36. public function add($sModule, $iProfileId, $sValue, $iObject, $bAutoActivation)
  37. {
  38. return $this->_oDb->add($sModule, $iProfileId, $sValue, $iObject, $bAutoActivation);
  39. }
  40. public function getUrl ($sModule, $sValue, $sAddParams = '')
  41. {
  42. return BX_DOL_URL_ROOT . 'searchKeyword.php?keyword=' . rawurlencode($sValue) . '&cat=multi&section=' . $sModule . $sAddParams;
  43. }
  44. }
  45. /** @} */