1
0

BxBaseModProfileVote.php 958 B

12345678910111213141516171819202122232425262728293031323334353637
  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 BaseProfile Base classes for profile modules
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxBaseModProfileVote extends BxTemplVoteLikes
  12. {
  13. protected $_sModule;
  14. protected $_oModule;
  15. function __construct($sSystem, $iId, $iInit = 1)
  16. {
  17. parent::__construct($sSystem, $iId, $iInit);
  18. $this->_oModule = BxDolModule::getInstance($this->_sModule);
  19. }
  20. public function getObjectAuthorId($iObjectId = 0)
  21. {
  22. if(!BxDolService::call($this->_sModule, 'act_as_profile'))
  23. return parent::getObjectAuthorId ($iObjectId);
  24. $oProfile = BxDolProfile::getInstanceByContentAndType($iObjectId ? $iObjectId : $this->getId(), $this->_sModule);
  25. if(!$oProfile)
  26. return 0;
  27. return $oProfile->id();
  28. }
  29. }
  30. /** @} */