public function getEventTypes(array $options = []): array
    {
        $result = [];

        if (!empty($options['calendar'])) {
            $types = json_decode($options['calendar']->event_types, true);
            foreach ($types as $type) {
                $result[$type] = $type;
            }

            asort($result);

            return $result;
        }

        $event = new Event('App.Calendars.getCalendarEventTypes', $this, [
            'user' => $options['user'],
        ]);

        EventManager::instance()->dispatch($event);

        if (!empty($event->result)) {
            $result = array_merge($result, $event->result);
        }

        $configEventTypes = $this->getEventTypeBy();
        $result = array_merge($result, $configEventTypes);

        return $result;
    }