Jake Vanderwerf
9 days ago ed57c386db34d8693ca75311972d0929ebe5f488
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
namespace JVBase\managers\SEO\render\Traits\_Properties;
 
if (!defined('ABSPATH')) {
    exit;
}
trait acceptsReservationsTrait {
    /**
     * @var bool|string Indicates whether a FoodEstablishment accepts reservations. Values can be Boolean, an URL at which reservations can be made or (for backwards compatibility) the strings Yes or No.
     */
    protected bool|string $acceptsReservations;
 
    public function getAcceptsReservations():bool|string|null
    {
        return $this->acceptsReservations??null;
    }
    public function setAcceptsReservations(bool|string $acceptsReservations):void
    {
        if (is_string($acceptsReservations)) {
            if (!filter_var($acceptsReservations, FILTER_VALIDATE_URL)) {
                error_log('[SEO] AcceptsReservations must be a URL pointing to where reservations can be made, or a boolean value.');
                return;
            }
        }
        $this->acceptsReservations = $acceptsReservations;
    }
}