private function loadItemOrThrowException(
        QueryBuildingEventInterface $event,
        string $eventName,
        EventDispatcherInterface $dispatcher
    ) {
        $queryResult = $this->executeItemQuery($event, $eventName, $dispatcher);

        if (empty($queryResult) && $this->noItemException) {
            $this->logger->notice(
                'Item not found from loader',
                [
                    'loader class' => static::class,
                    'from event' => $eventName,
                    'dispatched event' => $this->itemEventName
                ]
            );

            throw new \RuntimeException('Item not found from loader', 404);
        }

        return $queryResult;
    }
private function loadItemOrThrowException(
        QueryBuildingEventInterface $event,
        string $eventName,
        EventDispatcherInterface $dispatcher
    ) {
        $queryResult = $this->executeItemQuery($event, $eventName, $dispatcher);

        if (empty($queryResult) && $this->noItemException) {
            $this->logger->notice(
                'Item not found from loader',
                [
                    'loader class' => static::class,
                    'from event' => $eventName,
                    'dispatched event' => $this->itemEventName
                ]
            );

            throw new \RuntimeException('Item not found from loader', 404);
        }

        return $queryResult;
    }
private function loadItemOrThrowException ( QueryBuildingEventInterface $ event , string $ eventName , EventDispatcherInterface $ dispatcher ) { $ queryResult = $ this -> executeItemQuery ( $ event , $ eventName , $ dispatcher ) ; if ( empty ( $ queryResult ) && $ this -> noItemException ) { $ this -> logger -> notice ( 'Item not found from loader' , [ 'loader class' => static :: class , 'from event' => $ eventName , 'dispatched event' => $ this -> itemEventName ] ) ; throw new \ RuntimeException ( 'Item not found from loader' , 404 ) ; } return $ queryResult ; }
Load item or throw exception

Load an item by executing the executeQueryItem. In case of item cannot be resolved, this method will throw a
RuntimeException. The exception throwing can be disabled by the $noItemException constructor argument.

@param ProcessEventInterface    $event      The original event.
@param string                   $eventName  The original event name.
@param EventDispatcherInterface $dispatcher The event dispatcher.

@throws                                      \RuntimeException If the item cannot be loaded
@return                                      mixed
@SuppressWarnings(PHPMD.UnusedPrivateMethod)
Load item or throw exception