blocked_period.php
3 months ago
booked_period.php
3 months ago
booking_request.php
3 months ago
booking_resource.php
3 months ago
booking_slot.php
3 months ago
filter.php
3 months ago
process_action.php
1 month ago
process_event.php
1 month ago
role.php
3 weeks ago
router.php
3 months ago
step.php
3 months ago
stripe_connect_customer.php
3 months ago
time_period.php
3 months ago
user.php
3 months ago
work_period.php
3 months ago
blocked_period.php
41 lines
| 1 | <?php |
| 2 | /* |
| 3 | * Copyright (c) 2022 LatePoint LLC. All rights reserved. |
| 4 | * |
| 5 | * This class is used to create blocked periods in resources |
| 6 | */ |
| 7 | |
| 8 | namespace LatePoint\Misc; |
| 9 | |
| 10 | class BlockedPeriod { |
| 11 | public string $start_date; |
| 12 | public string $end_date; |
| 13 | public int $start_time = 0; |
| 14 | public int $end_time = 0; |
| 15 | public ?int $service_id = 0; |
| 16 | public ?int $agent_id = 0; |
| 17 | public ?int $location_id = 0; |
| 18 | |
| 19 | function __construct( $args = [] ) { |
| 20 | $allowed_props = static::allowed_props(); |
| 21 | foreach ( $args as $key => $arg ) { |
| 22 | if ( in_array( $key, $allowed_props ) ) { |
| 23 | $this->$key = $arg; |
| 24 | } |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | public static function allowed_props(): array { |
| 29 | return [ |
| 30 | 'start_date', |
| 31 | 'end_date', |
| 32 | 'start_time', |
| 33 | 'end_time', |
| 34 | 'service_id', |
| 35 | 'agent_id', |
| 36 | 'location_id', |
| 37 | 'reason', |
| 38 | ]; |
| 39 | } |
| 40 | } |
| 41 |