@param $eventInfo

@return null|BaseAuditLog

@throws UnrecognizedEventInfoException
@throws \Exception
164488
protected function getEventLogObject($eventInfo)
    {
        if (empty($eventInfo)) {
            return null;
        }

        if ($eventInfo instanceof BaseAuditLog) {
            return $eventInfo;
        }

        return $this->createEventObjectFromArray($eventInfo);
    }
586098
public function getEventSourceId()
    {
        if ($this->isUserEvent()) {
            return $this->getUserId();
        }

        if ($this->isGroupEvent()) {
            return $this->getGroupId();
        }

        if ($this->isRoomEvent()) {
            return $this->getRoomId();
        }

        # Unknown event
        return null;
    }
1239722
protected function get_legacy_eventdata() {
        $attempt = $this->get_record_snapshot('quiz_attempts', $this->objectid);

        $legacyeventdata = new \stdClass();
        $legacyeventdata->component = 'mod_quiz';
        $legacyeventdata->attemptid = $this->objectid;
        $legacyeventdata->timestamp = $attempt->timemodified;
        $legacyeventdata->userid = $this->relateduserid;
        $legacyeventdata->quizid = $attempt->quiz;
        $legacyeventdata->cmid = $this->contextinstanceid;
        $legacyeventdata->courseid = $this->courseid;
        $legacyeventdata->submitterid = $this->other['submitterid'];

        return $legacyeventdata;
    }
384925
public function withDefaultValidationFailedEvent(string $eventClass): self
    {
        if (false === \is_a($eventClass, ValidationFailedEvent::class, true))
        {
            throw new InvalidEventType(
                \sprintf(
                    'Event class "%s" must implement "%s" interface',
                    $eventClass,
                    ValidationFailedEvent::class
                )
            );
        }

        $defaultThrowableEvent = $this->defaultThrowableEvent;

        /**
         * @psalm-var class-string $eventClass
         * @psalm-var class-string|null $defaultThrowableEvent
         */

        return new self(
            $this->isEventListener,
            $this->isCommandHandler,
            $this->validationEnabled,
            $this->validationGroups,
            $eventClass,
            $defaultThrowableEvent
        );
    }
802006
protected static function restore_event_from_standard_record($data) {
        $extra = ['origin' => $data->origin, 'ip' => $data->ip, 'realuserid' => $data->realuserid];
        $data = (array) $data;
        $id = $data['id'];
        $data['other'] = self::decode_other($data['other']);
        if ($data['other'] === false) {
            $data['other'] = [];
        }
        unset($data['origin']);
        unset($data['ip']);
        unset($data['realuserid']);
        unset($data['id']);

        if (!$event = \core\event\base::restore($data, $extra)) {
            return null;
        }

        return $event;
    }
379588
private function listenTo($event = null) {
        if ($event === null && $this->getEventInvoker()) {
            $event = $this->getEventInvoker()['id'];
        }
        return !$this->listen || in_array($event, $this->listen);
    }
927908
public function findOne($eventName)
    {
        foreach ($this->events as $event) {
            if ((string) new EventName($event) === $eventName) {
                return $event;
            }
        }

        return null;
    }
1159993
protected function registerArchivableAuditEvent($base = [])
    {
        if ($this->owner->getBehavior('Auditable') === null) {
            return false;
        }
        $eventLog = $base;
        if (!isset($eventLog['class'])) {
            return false;
        }
        $eventLog['directObject'] = $this->owner;
        $eventLog['indirectObject'] = $this->owner->indirectObject;

        return $this->owner->registerAuditEvent($eventLog);
    }
731471
public function getEventLogInfo(Event $event, $eventName)
    {
        if (!$event instanceof DoctrineObjectEvent) {
            return null;
        }

        $this->initialize($event, $eventName);

        if ($this->isUpdateEvent() && null === $this->getChangeSets($this->entity)) {
            return null;
        }

        $reflectionClass = $this->getReflectionClassFromObject($this->entity);

        return array(
            'description' => $this->getDescription($reflectionClass->getShortName()),
            'type' => $this->getEventType($reflectionClass->getShortName()),
        );
    }
460144
public function getAudience($audienceId)
    {
        if (isset($this->_audienceIdMap[$audienceId])) {
            return $this->_audienceIdMap[$audienceId];
        }

        $this->_logger->log(Logger::ERROR, sprintf('Audience ID "%s" is not in datafile.', $audienceId));
        $this->_errorHandler->handleError(new InvalidAudienceException('Provided audience is not in datafile.'));

        return null;
    }
114919
public function resolve($event)
    {
        if ($event instanceof FilterUserResponseEvent) {
            return $this->getEventDetailsArray($event->getUser()->getUsername());
        }

        return null;
    }
235354
public function getEvent()
    {
        if (null === $this->event) {
            $event = new AuthenticationEvent();

            $this->setEvent($event);
        }

        return $this->event;
    }
397885
protected function getEventLogInfo(Event $event, $eventName)
    {
        if ($event instanceof EmbeddedEventResolverInterface) {
            return $event->getEventLogInfo($eventName);
        }

        if (null === $eventResolver = $this->getResolver($eventName)) {
            return null;
        }

        return $eventResolver->getEventLogInfo($event, $eventName);
    }
502322
public function filter(EventInterface $event)
    {
        $output = null;
        foreach ($this->filters as $filter) {
            $result = $filter->filter($event);
            if ($result === false) {
                return false;
            }
            if ($result === true) {
                $output = true;
            }
        }
        return $output;
    }
1363062
public function getEvent(string $event)
    {
        $class = (string)$this->sprintf(':namespace\Event\:event', __NAMESPACE__, $event);

        if (class_exists($class)) {
            return new $class($this);
        }

        return null;
    }
785878
public function inspect(EventInterface $event)
    {
        if (! $event instanceof MvcEvent) {
            return new NullInspection();
        }

        $request = $event->getRequest();

        if (! $request instanceof RequestInterface) {
            return new NullInspection();
        }

        return new RequestInspection($request);
    }
952220
public function validate(\Upload\FileInfoInterface $fileInfo)
    {
        $fileSize = $fileInfo->getSize();

        if ($fileSize < $this->minSize) {
            throw new \Upload\Exception(sprintf('File size is too small. Must be greater than or equal to: %s', $this->minSize), $fileInfo);
        }

        if ($fileSize > $this->maxSize) {
            throw new \Upload\Exception(sprintf('File size is too large. Must be less than: %s', $this->maxSize), $fileInfo);
        }
    }