1
|
|
|
<?php namespace VojtaSvoboda\Reservations\Classes; |
2
|
|
|
|
3
|
|
|
use Config; |
4
|
|
|
use VojtaSvoboda\Reservations\Models\Settings; |
5
|
|
|
|
6
|
|
|
class Variables |
7
|
|
|
{ |
8
|
|
|
public static function getDateTimeFormat() |
9
|
|
|
{ |
10
|
|
|
$default = Config::get('vojtasvoboda.reservations::config.formats.datetime', 'd/m/Y H:i'); |
11
|
|
|
|
12
|
|
|
return Settings::get('formats_datetime', $default); |
13
|
|
|
} |
14
|
|
|
|
15
|
|
|
public static function getDateFormat() |
16
|
|
|
{ |
17
|
|
|
$default = Config::get('vojtasvoboda.reservations::config.formats.date', 'd/m/Y'); |
18
|
|
|
|
19
|
|
|
return Settings::get('formats_date', $default); |
20
|
|
|
} |
21
|
|
|
|
22
|
|
|
public static function getTimeFormat() |
23
|
|
|
{ |
24
|
|
|
$default = Config::get('vojtasvoboda.reservations::config.formats.time', 'H:i'); |
25
|
|
|
|
26
|
|
|
return Settings::get('formats_time', $default); |
27
|
|
|
} |
28
|
|
|
|
29
|
|
|
public static function getReservationInterval() |
30
|
|
|
{ |
31
|
|
|
$default = Config::get('vojtasvoboda.reservations::config.reservation.interval', 15); |
32
|
|
|
|
33
|
|
|
return (int) Settings::get('reservation_interval', $default); |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
public static function getReservationLength() |
37
|
|
|
{ |
38
|
|
|
$default = (int) Config::get('vojtasvoboda.reservations::config.reservation.length', 2); |
39
|
|
|
|
40
|
|
|
return Settings::get('reservation_length', $default) . ' hours'; |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
public static function getWorkingDays() |
44
|
|
|
{ |
45
|
|
|
$default = ['monday', 'tuesday', 'wednesday', 'thursday', 'friday']; |
46
|
|
|
|
47
|
|
|
return Settings::get('work_days', $default); |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
public static function getFirstWeekday() |
51
|
|
|
{ |
52
|
|
|
return (int) Settings::get('first_weekday', false); |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
public static function getWorkTimeFrom() |
56
|
|
|
{ |
57
|
|
|
return Settings::get('work_time_from', '10:00'); |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
public static function getWorkTimeTo() |
61
|
|
|
{ |
62
|
|
|
return Settings::get('work_time_to', '18:00'); |
63
|
|
|
} |
64
|
|
|
} |
65
|
|
|
|