Uname: Linux webm012.cluster130.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
Software: Apache
PHP version: 8.0.30 [ PHP INFO ] PHP os: Linux
Server Ip: 145.239.37.162
Your Ip: 216.73.216.190
User: dreampi (1009562) | Group: users (100)
Safe Mode: OFF
Disable Function:
_dyuweyrj4,_dyuweyrj4r,dl

name : CalendarEventService.php
<?php

namespace FluentBooking\App\Services;

use FluentBooking\App\Models\Calendar;
use FluentBooking\Framework\Support\Arr;

class CalendarEventService
{
    public static function processEvent($calendarEvent)
    {
        $calendarEvent->payment_html = $calendarEvent->getPaymentHtml();

        $calendarEvent->public_url = $calendarEvent->getPublicUrl();

        $calendarEvent->durations = $calendarEvent->getAvailableDurations();

        $calendarEvent->description = $calendarEvent->getDescription();

        $calendarEvent->locations = $calendarEvent->defaultLocationHtml();

        do_action_ref_array('fluent_booking/processed_event', [&$calendarEvent]);

        return $calendarEvent;
    }

    public static function processEvents(Calendar $calendar, $calendarEvents)
    {
        $eventOrder = $calendar->getMeta('event_order');

        if (!empty($eventOrder)) {
            $calendarEvents = $calendarEvents->sortBy(function($event) use ($eventOrder) {
                return array_search($event->id, $eventOrder);
            })->values();
        }

        foreach ($calendarEvents as $calendarEvent) {
            $calendarEvent = self::processEvent($calendarEvent);
        }

        return $calendarEvents;
    }

    public static function isSharedCalendarEvent($calendarEvent)
    {
        $userId = get_current_user_id();

        if ($calendarEvent->user_id == $userId) {
            return true;
        }

        $teamMembers = Arr::get($calendarEvent, 'settings.team_members', []);

        return in_array($userId, $teamMembers);
    }
}
© 2026 GrazzMean-Shell