BxBaseServices.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  4. * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  5. *
  6. * @defgroup DolphinCore Dolphin Core
  7. * @{
  8. */
  9. /**
  10. * System services.
  11. */
  12. class BxBaseServices extends BxDol implements iBxDolProfileService {
  13. public function __construct() {
  14. parent::__construct();
  15. }
  16. public function serviceProfileUnit ($iContentId) {
  17. return $this->_serviceProfileFunc('getUnit', $iContentId);
  18. }
  19. public function serviceProfileAvatar ($iContentId) {
  20. return $this->_serviceProfileFunc('getAvatar', $iContentId);
  21. }
  22. public function serviceProfileThumb ($iContentId) {
  23. return $this->_serviceProfileFunc('getThumb', $iContentId);
  24. }
  25. public function serviceProfileIcon ($iContentId) {
  26. return $this->_serviceProfileFunc('getIcon', $iContentId);
  27. }
  28. public function serviceProfileName ($iContentId) {
  29. return $this->_serviceProfileFunc('getDisplayName', $iContentId);
  30. }
  31. public function serviceProfileUrl ($iContentId) {
  32. return $this->_serviceProfileFunc('getUrl', $iContentId);
  33. }
  34. public function _serviceProfileFunc ($sFunc, $iContentId) {
  35. if (!$iContentId)
  36. return false;
  37. if (!($oAccount = BxDolAccount::getInstance($iContentId)))
  38. return false;
  39. return $oAccount->$sFunc();
  40. }
  41. }
  42. /** @} */