Availability_Options
Stores availability options for the restaurant menu (the opening hours, etc).
Tags
Table of Contents
- $args : array<string|int, mixed>
- $opening_hours : Opening_Hours
- __construct() : mixed
- Constructor.
- are_opening_hours_enabled() : bool
- get_closed_notice() : string
- get_defaults() : array<string|int, mixed>
- Get the availability default options.
- get_open_notice() : string
- get_opening_hours() : Opening_Hours
- get_options() : array<string|int, mixed>
- Get the full list of availability options as an array.
- is_restaurant_open() : bool
- get_settings() : array<string|int, mixed>
- Get the availability plugin settings from the database, merged with the defaults.
- parse_args() : array<string|int, mixed>
- replace_tags() : string
- Replace tags in the availability notices, e.g. {open_time}
Properties
$args
protected
array<string|int, mixed>
$args
The supplied args to create the availability options.
$opening_hours
protected
Opening_Hours
$opening_hours
The opening hours for the restaurant, created from the supplied $args.
Methods
__construct()
Constructor.
public
__construct([array<string|int, mixed> $args = [] ][, bool $load_settings = true ]) : mixed
Parameters
- $args : array<string|int, mixed> = []
- $load_settings : bool = true
Return values
mixed —are_opening_hours_enabled()
public
are_opening_hours_enabled() : bool
Return values
bool —get_closed_notice()
public
get_closed_notice() : string
Return values
string —get_defaults()
Get the availability default options.
public
static get_defaults() : array<string|int, mixed>
Return values
array<string|int, mixed> —The defaults
get_open_notice()
public
get_open_notice() : string
Return values
string —get_opening_hours()
public
get_opening_hours() : Opening_Hours
Return values
Opening_Hours —get_options()
Get the full list of availability options as an array.
public
get_options() : array<string|int, mixed>
Return values
array<string|int, mixed> —The availability options
is_restaurant_open()
public
is_restaurant_open() : bool
Return values
bool —get_settings()
Get the availability plugin settings from the database, merged with the defaults.
protected
get_settings() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —The settings
parse_args()
private
parse_args(array<string|int, mixed> $args) : array<string|int, mixed>
Parameters
- $args : array<string|int, mixed>
Return values
array<string|int, mixed> —replace_tags()
Replace tags in the availability notices, e.g. {open_time}
private
replace_tags(string $text) : string
Parameters
- $text : string
-
The text to replace tags in
Return values
string —The text with replacements