# fluent-booking/1.5.01/app/Services/Integrations/GlobalNotificationService.php

Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution, version 1.5.01. 70 lines.

- Page: https://pluginprobe.com/plugins/fluent-booking/1.5.01/code/app/Services/Integrations/GlobalNotificationService.php
- Raw: https://pluginprobe.com/plugins/fluent-booking/1.5.01/raw/app/Services/Integrations/GlobalNotificationService.php
- Modified: 2024-07-16T14:25:14+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/fluent-booking/1.5.01/code/app/Services/Integrations/GlobalNotificationService.php#L10-L20`.

```php
<?php

namespace FluentBooking\App\Services\Integrations;

use FluentBooking\App\Models\Meta;
use FluentBooking\Framework\Support\Arr;
use FluentBooking\App\Services\ConditionAssesor;

class GlobalNotificationService
{
    public function checkCondition($parsedValue, $booking)
    {
        return true;

        $conditionSettings = Arr::get($parsedValue, 'conditionals');
        if (
            !$conditionSettings ||
            !Arr::isTrue($conditionSettings, 'status') ||
            !count(Arr::get($conditionSettings, 'conditions'))
        ) {
            return true;
        }

        return ConditionAssesor::evaluate($parsedValue, $booking);
    }

    public function getEntry($id, $form)
    {
        // $submission = Submission::find($id);
        // $formInputs = FormFieldsParser::getEntryInputs($form, ['admin_label', 'raw']);
        // return bookingParser::parseFormEntry($submission, $form, $formInputs);
    }

    /**
     * @param $feeds
     * @param $booking
     * @param $insertId
     *
     * @return array
     */
    public function getEnabledFeeds($feeds, $booking)
    {
        $enabledFeeds = [];
        foreach ($feeds as $feed) {
            $parsedValue = $feed->value;
            if (!$parsedValue || !Arr::isTrue($parsedValue, 'enabled')) {
                continue;
            }

            // Now check if conditions matched or not
            $isConditionMatched = $this->checkCondition($parsedValue, $booking);
            if ($isConditionMatched) {
                $item = [
                    'id'       => $feed->id,
                    'key'      => $feed->key,
                    'settings' => $parsedValue,
                ];
                $enabledFeeds[] = $item;
            }
        }

        return $enabledFeeds;
    }

    public function getNotificationFeeds($slotId, $feedMetaKeys)
    {
        return Meta::where('object_id', $slotId)->whereIn('key', $feedMetaKeys)->orderBy('id', 'ASC')->get();
    }
}

```
