<?php
|
namespace JVBase\managers\SEO\render\Traits\_Properties;
|
|
use JVBase\managers\SEO\render\Traits\_Helpers\arrayHelper;
|
|
if (!defined('ABSPATH')) {
|
exit;
|
}
|
trait openingHoursTrait {
|
use arrayHelper;
|
/**
|
* @var array|string The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas ',' separating each day. Day or time ranges are specified using a hyphen '-'.
|
*
|
* Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su.
|
* Times are specified using 24:00 format. For example, 3pm is specified as 15:00, 10am as 10:00.
|
* Here is an example: <time itemprop="openingHours" datetime="Tu,Th 16:00-20:00">Tuesdays and Thursdays 4-8pm</time>.
|
* If a business is open 7 days a week, then it can be specified as <time itemprop="openingHours" datetime="Mo-Su">Monday through Sunday, all day</time>.
|
*/
|
protected array|string $openingHours;
|
|
public function getOpeningHours():array|string|null
|
{
|
return $this->openingHours??null;
|
}
|
public function setOpeningHours(array|string $openingHours):void
|
{
|
if (is_array($openingHours)) {
|
$openingHours = $this->stringArray('openingHours', $openingHours);
|
}
|
$this->openingHours = $openingHours;
|
}
|
}
|