This commit is contained in:
Yuri Kuznetsov
2024-01-12 17:25:56 +02:00
parent 34598d73a3
commit 89fa12c6db
2 changed files with 7 additions and 18 deletions
@@ -31,7 +31,6 @@ namespace Espo\Hooks\Common;
use Espo\Core\ORM\Repository\Option\SaveOption;
use Espo\ORM\Entity;
use Espo\Tools\Stream\Service as Service;
/**
@@ -40,21 +39,18 @@ use Espo\Tools\Stream\Service as Service;
*
* When users or teams of `related` or `parent` record are changed
* the note record will be changed too.
*
* @noinspection PhpUnused
*/
class StreamNotesAcl
{
public static int $order = 10;
private Service $service;
public function __construct(Service $service)
{
$this->service = $service;
}
public function __construct(private Service $service)
{}
/**
* @param array<string, mixed> $options
* @throws \Espo\Core\Exceptions\Error
*/
public function afterSave(Entity $entity, array $options): void
{
@@ -31,23 +31,16 @@ namespace Espo\Tools\Stream\Jobs;
use Espo\Core\Job\Job;
use Espo\Core\Job\Job\Data;
use Espo\ORM\EntityManager;
use Espo\Tools\Stream\Service as Service;
class ProcessNoteAcl implements Job
{
private Service $service;
private EntityManager $entityManager;
public function __construct(
Service $service,
EntityManager $entityManager
) {
$this->service = $service;
$this->entityManager = $entityManager;
}
private Service $service,
private EntityManager $entityManager
) {}
public function run(Data $data): void
{