public function getByAllowedEventTypes(?string $tableName = null, array $options = []): array
    {
        $result = [];
        $query = $this->find();
        $query->execute();
        $query->all();

        if (!$query->count()) {
            return $result;
        }

        $resultSet = $query->all();

        foreach ($resultSet as $calendar) {
            if (empty($calendar->event_types)) {
                continue;
            }

            $event_types = json_decode($calendar->event_types, true);

            $found = array_filter($event_types, function ($item) use ($tableName) {
                if (preg_match("/$tableName::/", $item, $matches)) {
                    return $item;
                }
            });

            if (!empty($found)) {
                $result[] = $calendar;
            }
        }

        return $result;
    }