BxBaseServiceCategory.php 892 B

12345678910111213141516171819202122232425262728293031
  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 UnaBaseView UNA Base Representation Classes
  7. * @{
  8. */
  9. /**
  10. * Services for category objects functionality - @see BxDolCategory
  11. */
  12. class BxBaseServiceCategory extends BxDol
  13. {
  14. /**
  15. * Get categories list
  16. */
  17. public function serviceCategoriesList ($sObject, $aParams = array())
  18. {
  19. $bShowEmpty = isset($aParams['show_empty']) ? (bool)$aParams['show_empty'] : false;
  20. $bShowEmptyCategories = isset($aParams['show_empty_categories']) ? (bool)$aParams['show_empty_categories'] : false;
  21. $sResult = BxDolCategory::getObjectInstance($sObject)->getCategoriesList($bShowEmptyCategories);
  22. if(empty($sResult))
  23. return $bShowEmpty ? MsgBox(_t('_Empty')) : '';
  24. return $sResult;
  25. }
  26. }
  27. /** @} */