BxDolConnectionBan.php 1.1 KB

123456789101112131415161718192021222324252627282930313233
  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 BxDolConnectionBan extends BxDolConnection
  10. {
  11. protected function __construct($aObject)
  12. {
  13. parent::__construct($aObject);
  14. }
  15. /**
  16. * Add new connection.
  17. * @param $iInitiator initiator of the connection, in most cases some profile id
  18. * @param $iContent content to make connection to, in most cases some content id, or other profile id in case of friends
  19. * @return true - if connection was added, false - if connection already exists or error occured
  20. */
  21. public function addConnection($iInitiator, $iContent, $aParams = [])
  22. {
  23. $bResult = parent::addConnection($iInitiator, $iContent, $aParams);
  24. if($bResult)
  25. $this->_oQuery->updateConnection($iInitiator, $iContent, [
  26. 'module' => !empty($aParams['module']) ? $aParams['module'] : BxDolProfile::getInstance($iInitiator)->getModule(),
  27. ]);
  28. return $bResult;
  29. }
  30. }