IsOfferOrDemand::GetSeller()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 12
ccs 6
cts 6
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
* @author SignpostMarv
4
*/
5
declare(strict_types=1);
6
7
namespace SignpostMarv\DaftObject\SchemaOrg\DaftObjectTraits;
8
9
use SignpostMarv\DaftObject\SchemaOrg\Intangible\Enumeration\DeliveryMethod;
10
use SignpostMarv\DaftObject\SchemaOrg\Intangible\Service;
11
use SignpostMarv\DaftObject\SchemaOrg\Intangible\StructuredValue\PriceSpecification;
12
use SignpostMarv\DaftObject\SchemaOrg\Intangible\StructuredValue\QuantitativeValue;
13
use SignpostMarv\DaftObject\SchemaOrg\Intangible\StructuredValue\WarrantyPromise;
14
use SignpostMarv\DaftObject\SchemaOrg\Organization;
15
use SignpostMarv\DaftObject\SchemaOrg\Person;
16
use SignpostMarv\DaftObject\SchemaOrg\Place;
17
use SignpostMarv\DaftObject\SchemaOrg\Product;
18
use SignpostMarv\DaftObject\SchemaOrg\Thing;
19
use SignpostMarv\DaftObject\SchemaOrg\TypeUtilities;
20
21
trait IsOfferOrDemand
22
{
23
    use AcceptedPaymentMethod;
24
    use AdvanceBookingRequirement;
25
    use HasAreaServed;
26
    use AvailabilityAndStartsAndEnds;
27
    use BusinessFunction;
28
    use DeliveryLeadTime;
29
    use EligibleCustomerTypeAndDurationAndQuantityAndRegionAndTransactionVolumeAndIneligibleRegion;
30
    use HasGtin;
31
    use IncludesObject;
32
    use HasValidFromThrough;
33
    use HasSku;
34
35
    /**
36
    * @return array<int, Place>
37
    */
38 48
    public function GetAvailableAtOrFrom() : array
39
    {
40
        /**
41
        * @var array<int, Place>
42
        */
43 48
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
44 48
            'availableAtOrFrom',
45 48
            $this->RetrievePropertyValueFromData('availableAtOrFrom'),
46 48
            static::class
47
        );
48
49 48
        return $out;
50
    }
51
52
    /**
53
    * @param array<int, Place> $value
54
    */
55 2
    public function SetAvailableAtOrFrom(array $value) : void
56
    {
57 2
        $this->NudgePropertyValue(
58 2
            'availableAtOrFrom',
59 2
            $value
60
        );
61 2
    }
62
63
    /**
64
    * @return array<int, DeliveryMethod>
65
    */
66 48
    public function GetAvailableDeliveryMethod() : array
67
    {
68
        /**
69
        * @var array<int, DeliveryMethod>
70
        */
71 48
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
72 48
            'availableDeliveryMethod',
73 48
            $this->RetrievePropertyValueFromData('availableDeliveryMethod'),
74 48
            static::class
75
        );
76
77 48
        return $out;
78
    }
79
80
    /**
81
    * @param array<int, DeliveryMethod> $value
82
    */
83 2
    public function SetAvailableDeliveryMethod(array $value) : void
84
    {
85 2
        $this->NudgePropertyValue(
86 2
            'availableDeliveryMethod',
87 2
            $value
88
        );
89 2
    }
90
91
    /**
92
    * @return array<int, QuantitativeValue>
93
    */
94 48
    public function GetInventoryLevel() : array
95
    {
96
        /**
97
        * @var array<int, QuantitativeValue>
98
        */
99 48
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
100 48
            'inventoryLevel',
101 48
            $this->RetrievePropertyValueFromData('inventoryLevel'),
102 48
            static::class
103
        );
104
105 48
        return $out;
106
    }
107
108
    /**
109
    * @param array<int, QuantitativeValue> $value
110
    */
111 2
    public function SetInventoryLevel(array $value) : void
112
    {
113 2
        $this->NudgePropertyValue(
114 2
            'inventoryLevel',
115 2
            $value
116
        );
117 2
    }
118
119
    /**
120
    * @return array<int, Product|Service>
121
    */
122 48
    public function GetItemOffered() : array
123
    {
124
        /**
125
        * @var array<int, Product|Service>
126
        */
127 48
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
128 48
            'itemOffered',
129 48
            $this->RetrievePropertyValueFromData('itemOffered'),
130 48
            static::class
131
        );
132
133 48
        return $out;
134
    }
135
136
    /**
137
    * @param array<int, Product|Service> $value
138
    */
139 2
    public function SetItemOffered(array $value) : void
140
    {
141 2
        $this->NudgePropertyValue(
142 2
            'itemOffered',
143 2
            $value
144
        );
145 2
    }
146
147
    /**
148
    * @return array<int, PriceSpecification>
149
    */
150 48
    public function GetPriceSpecification() : array
151
    {
152
        /**
153
        * @var array<int, PriceSpecification>
154
        */
155 48
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
156 48
            'priceSpecification',
157 48
            $this->RetrievePropertyValueFromData('priceSpecification'),
158 48
            static::class
159
        );
160
161 48
        return $out;
162
    }
163
164
    /**
165
    * @param array<int, PriceSpecification> $value
166
    */
167 2
    public function SetPriceSpecification(array $value) : void
168
    {
169 2
        $this->NudgePropertyValue(
170 2
            'priceSpecification',
171 2
            $value
172
        );
173 2
    }
174
175
    /**
176
    * @return array<int, Organization|Person>
177
    */
178 48
    public function GetSeller() : array
179
    {
180
        /**
181
        * @var array<int, Organization|Person>
182
        */
183 48
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
184 48
            'seller',
185 48
            $this->RetrievePropertyValueFromData('seller'),
186 48
            static::class
187
        );
188
189 48
        return $out;
190
    }
191
192
    /**
193
    * @param array<int, Organization|Person> $value
194
    */
195 2
    public function SetSeller(array $value) : void
196
    {
197 2
        $this->NudgePropertyValue(
198 2
            'seller',
199 2
            $value
200
        );
201 2
    }
202
203
    /**
204
    * @return array<int, string>
205
    */
206 48
    public function GetSerialNumber() : array
207
    {
208
        /**
209
        * @var array<int, string>
210
        */
211 48
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
212 48
            'serialNumber',
213 48
            $this->RetrievePropertyValueFromData('serialNumber'),
214 48
            static::class
215
        );
216
217 48
        return $out;
218
    }
219
220
    /**
221
    * @param array<int, string> $value
222
    */
223 2
    public function SetSerialNumber(array $value) : void
224
    {
225 2
        $this->NudgePropertyValue(
226 2
            'serialNumber',
227 2
            $value,
228 2
            Thing::BOOL_DEFAULT_AUTOTRIMSTRINGS
229
        );
230 2
    }
231
232
    /**
233
    * @return array<int, WarrantyPromise>
234
    */
235 48
    public function GetWarranty() : array
236
    {
237
        /**
238
        * @var array<int, WarrantyPromise>
239
        */
240 48
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
241 48
            'warranty',
242 48
            $this->RetrievePropertyValueFromData('warranty'),
243 48
            static::class
244
        );
245
246 48
        return $out;
247
    }
248
249
    /**
250
    * @param array<int, WarrantyPromise> $value
251
    */
252 2
    public function SetWarranty(array $value) : void
253
    {
254 2
        $this->NudgePropertyValue(
255 2
            'warranty',
256 2
            $value
257
        );
258 2
    }
259
}
260