Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

Commit

Permalink
Merge branch 'developer' of github.com:YetiForceCompany/YetiForceCRM …
Browse files Browse the repository at this point in the history
…into developer
  • Loading branch information
mariuszkrzaczkowski committed Oct 18, 2022
2 parents 49b0915 + a96a3cd commit 86094e9
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions modules/Vtiger/models/Relation.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ class Vtiger_Relation_Model extends \App\Base
*/
protected $customViewList;

/**
* @var array Event handler exceptions
*/
protected $handlerExceptions = [];

//one to many
const RELATION_O2M = 1;

Expand Down Expand Up @@ -639,6 +644,9 @@ public function addRelation($sourceRecordId, $destinationRecordIds, $params = fa
];
$eventHandler = (new \App\EventHandler())->setModuleName($this->getRelationModuleModel()->getName());
$eventHandlerBySource = (new \App\EventHandler())->setModuleName($sourceModuleName);
if (!empty($this->getHandlerExceptions())) {
$eventHandler->setExceptions($this->getHandlerExceptions());
}
foreach ($destinationRecordIds as $destinationRecordId) {
$data['destinationRecordId'] = $destinationRecordId;
$eventHandler->setParams($data)->trigger('EntityBeforeLink');
Expand All @@ -652,6 +660,29 @@ public function addRelation($sourceRecordId, $destinationRecordIds, $params = fa
return $result;
}

/**
* Set handler exceptions.
*
* @param array $exceptions
*
* @return $this
*/
public function setHandlerExceptions(array $exceptions)
{
$this->handlerExceptions = $exceptions;
return $this;
}

/**
* get handler exceptions.
*
* @return array
*/
public function getHandlerExceptions(): array
{
return $this->handlerExceptions;
}

/**
* Transfer.
*
Expand Down

0 comments on commit 86094e9

Please sign in to comment.