BxBaseModProfileSearchResult.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  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 BaseProfile Base classes for profile modules
  7. * @ingroup TridentModules
  8. *
  9. * @{
  10. */
  11. class BxBaseModProfileSearchResult extends BxBaseModGeneralSearchResult
  12. {
  13. public function __construct($sMode = '', $aParams = array())
  14. {
  15. parent::__construct($sMode, $aParams);
  16. $this->sCenterContentUnitSelector = '.bx-base-pofile-unit';
  17. }
  18. protected function _setConnectionsConditions ($aParams)
  19. {
  20. $oConnection = isset($aParams['object']) ? BxDolConnection::getObjectInstance($aParams['object']) : false;
  21. if (!$oConnection || !isset($aParams['profile']) || !(int)$aParams['profile'])
  22. return false;
  23. $sContentType = isset($aParams['type']) ? $aParams['type'] : BX_CONNECTIONS_CONTENT_TYPE_CONTENT;
  24. $isMutual = isset($aParams['mutual']) ? $aParams['mutual'] : false;
  25. $a = $oConnection->getConnectionsAsCondition ($sContentType, 'id', (int)$aParams['profile'], (int)$aParams['profile2'], $isMutual);
  26. $this->aCurrent['restriction'] = array_merge($this->aCurrent['restriction'], $a['restriction']);
  27. $this->aCurrent['join'] = array_merge($this->aCurrent['join'], $a['join']);
  28. return true;
  29. }
  30. }
  31. /** @} */