private function hasBreakingRepeatEvent(SessionInterface $session, LogGenericEvent $event)
    {
        $hasBreakingRepeatEvent = false;
        $breakingSignatures = [
            LogWorkspaceToolReadEvent::ACTION,
            LogResourceReadEvent::ACTION,
            LogDesktopToolReadEvent::ACTION,
            LogAdminToolReadEvent::ACTION,
        ];
        $breakingWorkspaceSignatures = [
            LogDesktopToolReadEvent::ACTION,
            LogAdminToolReadEvent::ACTION,
        ];

        // Only checks for tools (desktop, workspace & admin) & resources opening
        if ($event->getIsWorkspaceEnterEvent() || $event->getIsToolReadEvent() || $event->getIsResourceReadEvent()) {
            if (!is_null($session->get($event->getAction()))) {
                $oldArray = json_decode($session->get($event->getAction()));
                $oldSignature = $oldArray->logSignature;
                $oldTime = $oldArray->time;

                foreach ($breakingSignatures as $breakingSignature) {
                    if ((($event->getIsWorkspaceEnterEvent() && in_array($breakingSignature, $breakingWorkspaceSignatures)) ||
                        (!$event->getIsWorkspaceEnterEvent() && $oldSignature !== $breakingSignature)) &&
                        $session->get($breakingSignature)
                    ) {
                        $breakingArray = json_decode($session->get($breakingSignature));

                        if ($oldTime < $breakingArray->time) {
                            $hasBreakingRepeatEvent = true;
                            break;
                        }
                    }
                }
            }
        }

        return $hasBreakingRepeatEvent;
    }
private function hasBreakingRepeatEvent(SessionInterface $session, LogGenericEvent $event)
    {
        $hasBreakingRepeatEvent = false;
        $breakingSignatures = [
            LogWorkspaceToolReadEvent::ACTION,
            LogResourceReadEvent::ACTION,
            LogDesktopToolReadEvent::ACTION,
            LogAdminToolReadEvent::ACTION,
        ];
        $breakingWorkspaceSignatures = [
            LogDesktopToolReadEvent::ACTION,
            LogAdminToolReadEvent::ACTION,
        ];

        // Only checks for tools (desktop, workspace & admin) & resources opening
        if ($event->getIsWorkspaceEnterEvent() || $event->getIsToolReadEvent() || $event->getIsResourceReadEvent()) {
            if (!is_null($session->get($event->getAction()))) {
                $oldArray = json_decode($session->get($event->getAction()));
                $oldSignature = $oldArray->logSignature;
                $oldTime = $oldArray->time;

                foreach ($breakingSignatures as $breakingSignature) {
                    if ((($event->getIsWorkspaceEnterEvent() && in_array($breakingSignature, $breakingWorkspaceSignatures)) ||
                        (!$event->getIsWorkspaceEnterEvent() && $oldSignature !== $breakingSignature)) &&
                        $session->get($breakingSignature)
                    ) {
                        $breakingArray = json_decode($session->get($breakingSignature));

                        if ($oldTime < $breakingArray->time) {
                            $hasBreakingRepeatEvent = true;
                            break;
                        }
                    }
                }
            }
        }

        return $hasBreakingRepeatEvent;
    }
private function hasBreakingRepeatEvent ( SessionInterface $ session , LogGenericEvent $ event ) { $ hasBreakingRepeatEvent = false ; $ breakingSignatures = [ LogWorkspaceToolReadEvent :: ACTION , LogResourceReadEvent :: ACTION , LogDesktopToolReadEvent :: ACTION , LogAdminToolReadEvent :: ACTION , ] ; $ breakingWorkspaceSignatures = [ LogDesktopToolReadEvent :: ACTION , LogAdminToolReadEvent :: ACTION , ] ; // Only checks for tools (desktop, workspace & admin) & resources opening if ( $ event -> getIsWorkspaceEnterEvent ( ) || $ event -> getIsToolReadEvent ( ) || $ event -> getIsResourceReadEvent ( ) ) { if ( ! is_null ( $ session -> get ( $ event -> getAction ( ) ) ) ) { $ oldArray = json_decode ( $ session -> get ( $ event -> getAction ( ) ) ) ; $ oldSignature = $ oldArray -> logSignature ; $ oldTime = $ oldArray -> time ; foreach ( $ breakingSignatures as $ breakingSignature ) { if ( ( ( $ event -> getIsWorkspaceEnterEvent ( ) && in_array ( $ breakingSignature , $ breakingWorkspaceSignatures ) ) || ( ! $ event -> getIsWorkspaceEnterEvent ( ) && $ oldSignature !== $ breakingSignature ) ) && $ session -> get ( $ breakingSignature ) ) { $ breakingArray = json_decode ( $ session -> get ( $ breakingSignature ) ) ; if ( $ oldTime < $ breakingArray -> time ) { $ hasBreakingRepeatEvent = true ; break ; } } } } } return $ hasBreakingRepeatEvent ; }
Checks if a tool has been opened between 2 resources opening.
If it is the case, the resource opening will not be labelled as a repeat even if it is the same resource.
The same is checked between 2 tools opening.

@param SessionInterface $session
@param LogGenericEvent  $event

@return bool
Checks if a tool has been opened between 2 resources opening . If it is the case the resource opening will not be labelled as a repeat even if it is the same resource . The same is checked between 2 tools opening .