massActionFactory = $massActionFactory; $this->entityManager = $entityManager; } /** * @param ?User $user Under what user to perform mass-update. If not specified, the system user will be used. * Access control is applied for the user. * @throws \Espo\Core\Exceptions\NotFound */ public function process(Params $params, Data $data, ?User $user = null): Result { $entityType = $params->getEntityType(); if (!$user) { $user = $this->entityManager->getEntityById(User::ENTITY_TYPE, self::DEFAULT_USER_ID); } if (!$user) { throw new RuntimeException("No user."); } $action = $this->massActionFactory->createForUser(self::ACTION, $entityType, $user); return $action->process($params, $data->toMassActionData()); } }