PluginProbe ʕ •ᴥ•ʔ
LatePoint – Calendar Booking Plugin for Appointments and Events / 5.1.7
LatePoint – Calendar Booking Plugin for Appointments and Events v5.1.7
5.6.5 5.6.4 5.6.3 5.6.2 5.6.1 5.6.0 5.5.2 5.5.1 5.5.0 5.4.2 trunk 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 5.1.6 5.1.7 5.1.8 5.1.9 5.1.91 5.1.92 5.1.93 5.1.94 5.2.0 5.2.1 5.2.10 5.2.11 5.2.2 5.2.3 5.2.4 5.2.5 5.2.6 5.2.7 5.2.8 5.2.9 5.3.0 5.3.1 5.3.2 5.4.0 5.4.1
latepoint / lib / misc / filter.php
latepoint / lib / misc Last commit date
blocked_period.php 1 year ago booked_period.php 1 year ago booking_request.php 1 year ago booking_resource.php 1 year ago booking_slot.php 1 year ago filter.php 1 year ago process_action.php 1 year ago process_event.php 1 year ago role.php 1 year ago router.php 1 year ago step.php 1 year ago stripe_connect_customer.php 1 year ago time_period.php 1 year ago user.php 1 year ago work_period.php 1 year ago
filter.php
57 lines
1 <?php
2 /*
3 * Copyright (c) 2021 LatePoint LLC. All rights reserved.
4 */
5
6 namespace LatePoint\Misc;
7
8 class Filter{
9 public $service_id = 0;
10 public $agent_id = 0;
11 public $location_id = 0;
12
13 public $connections = [];
14
15 public ?int $week_day = null;
16 public ?string $date_from = null;
17 public ?string $date_to = null;
18
19 public ?int $start_time = null;
20 public ?int $end_time = null;
21
22 public array $statuses = [];
23 public array $exclude_booking_ids = [];
24 public bool $consider_cart_items = false;
25 public bool $exact_match = false;
26 public int $timeshift_minutes = 0;
27
28 function __construct(array $args = []){
29 $allowed_args = [ 'service_id',
30 'agent_id',
31 'location_id',
32 'connections',
33 'date_from',
34 'date_to',
35 'start_time',
36 'end_time',
37 'week_day',
38 'statuses',
39 'exclude_booking_ids',
40 'timeshift_minutes',
41 'exact_match'];
42 foreach($args as $key => $arg){
43 if(in_array($key, $allowed_args)) $this->$key = $arg;
44 }
45 }
46
47 public static function create_from_booking_request(BookingRequest $booking_request): Filter{
48 return new self([ 'date_from' => $booking_request->start_date,
49 'start_time' => $booking_request->start_time,
50 'end_time' => $booking_request->end_time,
51 'agent_id' => $booking_request->agent_id,
52 'location_id' => $booking_request->location_id,
53 'service_id' => $booking_request->service_id]);
54 }
55
56 }
57