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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
| <?php
| namespace JVBase\managers\SEO\render\Traits\_Properties;
|
| use JVBase\managers\SEO\render\Thing\Intangible\Demand;
| use JVBase\managers\SEO\render\Thing\Intangible\Offer;
| use JVBase\managers\SEO\render\Traits\_Helpers\arrayHelper;
|
| if (!defined('ABSPATH')) {
| exit;
| }
| trait offersTrait {
| use arrayHelper;
| /**
| * @var Demand|Offer|array An offer to provide this item—for example, an offer to sell a product, rent the DVD of a movie, perform a service, or give away tickets to an event. Use businessFunction to indicate the kind of transaction offered, i.e. sell, lease, etc. This property can also be used to describe a Demand. While this property is listed as expected on a number of common types, it can be used in others. In that case, using a second type, such as Product or a subtype of Product, can clarify the nature of the offer.
| * Inverse property: itemOffered
| */
| protected Demand|Offer|array $offers;
|
| public function getOffers():Demand|Offer|array|null
| {
| return $this->offers??null;
| }
| public function setOffers(Demand|Offer|array $offers):void
| {
| if (is_array($offers)) {
| $offers = $this->mixedArray('offers', $offers,[
| 'JVBase\managers\SEO\render\Thing\Intangible\Demand',
| 'JVBase\managers\SEO\render\Thing\Intangible\Offer'
| ]);
| }
| $this->offers = $offers;
| }
| public function getOpeningHoursFieldConfig():array
| {
| return [
| 'type' => 'repeater',
| 'label' => 'Opening Hours',
| 'fields' => [
| 'dayOfWeek' => [
| 'type' => 'radio',
| 'label' => 'Day(s) of Week',
| 'options' => [
| 'Mo' => 'Monday',
| 'Tu' => 'Tuesday',
| 'We' => 'Wednesday',
| 'Th' => 'Thursday',
| 'Fr' => 'Friday',
| 'Sa' => 'Saturday',
| 'Su' => 'Sunday'
| ]
| ],
| 'opens' => [
| 'type' => 'time',
| 'label' => 'Opens At',
| ],
| 'closes' => [
| 'type' => 'time',
| 'label' => 'Closes At',
| ]
| ]
| ];
| }
| }
|
|