Get Event Title based on the Event information

@param mixed[] $event of the calendar event instance

@return string $event[title] with new title if extras present
423066
public function getEventTitle(array $event = []): string
    {
        $extra = [];

        if (!empty($event['calendar_attendees'])) {
            foreach ($event['calendar_attendees'] as $att) {
                if ($att instanceof EntityInterface) {
                    array_push($extra, $att->get('display_name'));
                }
            }
        }

        if (!empty($extra)) {
            $event['title'] .= ' - ' . implode("\n", $extra);
        }

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

        return null;
    }
558893
public function getListeners($event)
    {
        if (!isset($this->listeners[$event]) || !is_array($this->listeners[$event])) {
            return array();
        }
        
        return $this->listeners[$event];
    }
193663
public function addEvent($event) {
		$result = add_entity_relationship($event->guid, self::EVENT_CALENDAR_RELATIONSHIP, $this->guid);

		if ($result) {
			// allow events to fire after confirmation that it has been added to the calendar
			elgg_trigger_event('events_api', 'add_to_calendar', array('event' => $event, 'calendar' => $this));
		}
		return $result;
	}
1186375
public function format($event)
    {
        /** Retrieve the line and file if set and remove them from the formatted extra */
        $file       = $line = '';
        $priorities = 0;

        /** @noinspection UnSafeIsSetOverArrayInspection */
        if (isset($event['extra']['file'])) {
            $file = $event['extra']['file'];

            unset($event['extra']['file']);
        }

        /** @noinspection UnSafeIsSetOverArrayInspection */
        if (isset($event['extra']['line'])) {
            $line = $event['extra']['line'];

            unset($event['extra']['line']);
        }

        $event = $this->normalize($event);

        $message = ['message' => $event['message']];

        if ($event['context']) {
            $message['context'] = $event['context'];
        }

        if ($event['extra']) {
            $message['extra'] = $event['extra'];
        }

        /** @noinspection UnSafeIsSetOverArrayInspection */
        if (isset($this->priorities[$event['level']])) {
            $priorities = $this->priorities[$event['level']];
        }

        if (count($message) === 1) {
            $message = reset($message);
        }

        /** Create JSON object describing the appearance of the message in the console */
        $json = $this->toJson(
            [
                [
                    'Type'  => $priorities,
                    'File'  => $file,
                    'Line'  => $line,
                    'Label' => $event['channel']
                ],
                $message
            ]
        );

        return sprintf('%s|%s|', strlen($json), $json);
    }
244592
public static function bound($event)
    {
        return array_key_exists($event, static::$events)
            || array_key_exists(
                $event,
                isset(static::$events['__bow.transmission.event'])
                    ? static::$events['__bow.transmission.event']
                    : []
            )
            || array_key_exists(
                $event,
                isset(static::$events['__bow.once.event']) ? static::$events['__bow.once.event'] : []
            );
    }
1241990
private function getEventTags(Event $event)
    {
        return array_map(function ($value) {
            if (is_bool($value)) {
                $value = $value ? 'true' : 'false';
            }
            return $value;
        }, $event->getTags());
    }
745575
protected function raiseEvent($event)
    {
        if (!isset($this->eventHandlers[$event])) {
            return null;
        }

        $args = func_get_args();
        $args = array_slice($args, 1);

        // Check if the last argument is a callback.
        $count = count($args);
        $callBack = false;

        if (($count > 0) && is_object($args[$count - 1]) && is_callable($args[$count - 1])) {
            $callBack = $args[$count - 1];
            $args = array_slice($args, 0, -1);
        }

        $result = null;

        foreach ($this->eventHandlers[$event] as $delegate) {
            $answer = call_user_func_array($delegate, $args);

            if ($callBack !== false && $answer !== null) {
                call_user_func($callBack, $answer);
            }

            // If we don't have a result yet - make this the result. This way the first event handler to
            // return a non null result will be the overall result of the event.
            if ($result === null) {
                $result = $answer;
            }
        }

        return $result;
    }
916479
public function getNotificationsEmail($event)
    {
        $notificationEmailRepository = $this->getContainer()->get('doctrine')->getRepository(
            'CompoNotificationBundle:NotificationEmail'
        );

        return $notificationEmailRepository->findBy(['event' => $event]);
    }
1209492
public function match(string $event): array
    {
        $matches = [];

        //do the obvious match
        if (isset($this->observers[$event])) {
            $matches[$event] = array(
                'event' => $event,
                'pattern' => $event,
                'variables' => []
            );
        }

        //deal with regexp
        foreach ($this->regex as $pattern) {
            //if it matches
            if (preg_match_all($pattern, $event, $match)) {
                $variables = [];

                if (is_array($match) && !empty($match)) {
                    //flatten
                    $variables = call_user_func_array('array_merge', $match);
                    array_shift($variables);
                }

                $matches[$pattern] = array(
                    'event' => $event,
                    'pattern' => $pattern,
                    'variables' => $variables
                );
            }
        }

        return array_values($matches);
    }
1305733
private function addEvent($event)
    {
        if (is_string($event)) {
            $event = Event::named($event);
        }

        if (!$event instanceof EventInterface) {
            throw new \InvalidArgumentException(
                'Events should be provides as Event instances or string, received type: ' . gettype($event)
            );
        }

        $this->events[] = $event;

        return $event;
    }
916035
public function getEvent($event) : Event {
        return isset($this->registeredEvents[$event]) ? $this->registeredEvents[$event] : null;
    }
1175095
public function getListenerQueue($event)
    {
        if ($event instanceof EventInterface) {
            $event = $event->getName();
        }

        if (isset($this->listeners[$event])) {
            return $this->listeners[$event];
        }

        return null;
    }
1228410
private function getEventLevel(Event $event)
    {
        $type = $event->getType();

        switch ($type) {
            case Event::INFO:    return LogLevel::INFO;
            case Event::SUCCESS: return LogLevel::NOTICE;
            case Event::WARNING: return LogLevel::WARNING;
            case Event::ERROR:   return LogLevel::ERROR;
        }

        throw new \InvalidArgumentException("$type is not a valid event type");
    }
389119
public static function split($event)
   {
      if (!is_string($event)) {
         throw new InvalidArgumentException(
            "invalid value provided for 'event'; expecting an event name ".
            "or event name and namespace as string"
         );
      }

      list($type, $namespace) = array_pad(explode('.', $event, 2), 2, null);
      return [ 
         ($type === '') ? null : $type,
         ($namespace === '') ? null : $namespace
      ];
   }
525054
protected function getEventHandlers($event)
    {
        $logger = $this->getLogger();
        $handlers = array();

        foreach ($this->plugins as $plugin) {
            $callbacks = $plugin->getSubscribedEvents();
            if (!is_array($callbacks)) {
                $logger->warning('Plugin returns non-array value for event callbacks', array(
                    'plugin' => get_class($plugin),
                    'callbacks' => $callbacks,
                ));
                continue;
            }
            if (!isset($callbacks[$event])) {
                $logger->debug('Plugin does not handle event', array(
                    'plugin' => get_class($plugin),
                    'event' => $event,
                ));
                continue;
            }
            $callback = $callbacks[$event];
            $pluginCallback = array($plugin, $callback);
            if (is_callable($pluginCallback)) {
                $handlers[] = $pluginCallback;
            } elseif (is_callable($callback)) {
                $handlers[] = $callback;
            } else {
                $logger->warning('Plugin returns invalid event callback', array(
                    'plugin' => get_class($plugin),
                    'event' => $event,
                    'callback' => $callback,
                ));
            }
        }

        return $handlers;
    }
182658
public function resolve($event)
    {
        if ($event instanceof UserEvent) {
            return $this->getEventDetailsArray($event->getUser()->getUsername());
        }

        return null;
    }