factory = $factory; $this->acl = $acl; } /** * Perform a mass action. * * @throws Forbidden * @throws BadRequest */ public function process(string $entityType, string $action, Params $params, stdClass $data): Result { if (!$this->acl->checkScope($entityType)) { throw new ForbiddenSilent(); } $massAction = $this->factory->create($action, $entityType); $result = $massAction->process( $params, Data::fromRaw($data) ); if ($params->hasIds()) { return $result; } return $result->withNoIds(); } }