ref
This commit is contained in:
@@ -87,7 +87,7 @@ class BeforeCreate implements SaveHook
|
||||
$entity->clear('usersIds');
|
||||
$entity->clear('teamsIds');
|
||||
$entity->clear('portalsIds');
|
||||
$entity->set('usersIds', [$this->user->getId()]);
|
||||
$entity->setUsersIds([$this->user->getId()]);
|
||||
$entity->set('isForSelf', true);
|
||||
|
||||
break;
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
namespace Espo\Entities;
|
||||
|
||||
use Espo\Core\Field\LinkMultiple;
|
||||
use Espo\Core\Field\LinkParent;
|
||||
use Espo\Core\ORM\Entity;
|
||||
|
||||
@@ -306,4 +307,24 @@ class Note extends Entity
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string[] $ids
|
||||
*/
|
||||
public function setTeamsIds(array $ids): self
|
||||
{
|
||||
$this->set('teamsIds', $ids);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string[] $ids
|
||||
*/
|
||||
public function setUsersIds(array $ids): self
|
||||
{
|
||||
$this->set('usersIds', $ids);
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -397,13 +397,13 @@ class Service
|
||||
|
||||
$note->setAclIsProcessed();
|
||||
|
||||
$note->set('teamsIds', []);
|
||||
$note->set('usersIds', []);
|
||||
$note->setTeamsIds([]);
|
||||
$note->setUsersIds([]);
|
||||
|
||||
if ($entity->hasLinkMultipleField('teams')) {
|
||||
$teamIdList = $entity->getLinkMultipleIdList('teams');
|
||||
|
||||
$note->set('teamsIds', $teamIdList);
|
||||
$note->setTeamsIds($teamIdList);
|
||||
}
|
||||
|
||||
$ownerUserField = $this->aclManager->getReadOwnerUserField($entity->getEntityType());
|
||||
@@ -447,7 +447,7 @@ class Service
|
||||
$userIdList = [$userId];
|
||||
}
|
||||
|
||||
$note->set('usersIds', $userIdList);
|
||||
$note->setUsersIds($userIdList);
|
||||
}
|
||||
|
||||
public function noteEmailReceived(Entity $entity, Email $email, bool $isInitial = false): void
|
||||
@@ -1349,11 +1349,11 @@ class Service
|
||||
}
|
||||
|
||||
if ($teamsAttributeIsChanged || $forceProcessNoteNotifications) {
|
||||
$note->set('teamsIds', $teamIdList);
|
||||
$note->setTeamsIds($teamIdList);
|
||||
}
|
||||
|
||||
if ($usersAttributeIsChanged || $forceProcessNoteNotifications) {
|
||||
$note->set('usersIds', $userIdList);
|
||||
$note->setUsersIds($userIdList);
|
||||
}
|
||||
|
||||
$this->entityManager->saveEntity($note, [
|
||||
|
||||
Reference in New Issue
Block a user