Skip to content

Commit 0c7fe51

Browse files
committed
Add support for retail advert display options.
1 parent 14b0159 commit 0c7fe51

File tree

2 files changed

+124
-0
lines changed

2 files changed

+124
-0
lines changed
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
<?php
2+
3+
namespace Olsgreen\AutoTrader\Api\Builders;
4+
5+
class StockItemRetailAdvertsDisplayOptionsBuilder extends AbstractBuilder
6+
{
7+
protected $excludePreviousOwners = false;
8+
9+
protected $excludeStrapline = false;
10+
11+
protected $excludeMot = false;
12+
13+
protected $excludeWarranty = false;
14+
15+
protected $excludeInteriorDetails = false;
16+
17+
protected $excludeTyreCondition = false;
18+
19+
protected $excludeBodyCondition = false;
20+
21+
public function getExcludePreviousOwners(): bool
22+
{
23+
return $this->excludePreviousOwners;
24+
}
25+
26+
public function setExcludePreviousOwners(bool $value): self
27+
{
28+
$this->excludePreviousOwners = $value;
29+
30+
return $this;
31+
}
32+
33+
public function getExcludeStrapline(): bool
34+
{
35+
return $this->excludeStrapline;
36+
}
37+
38+
public function setExcludeStrapline(bool $value): self
39+
{
40+
$this->excludeStrapline = $value;
41+
42+
return $this;
43+
}
44+
45+
public function getExcludeMot(): bool
46+
{
47+
return $this->excludeMot;
48+
}
49+
50+
public function setExcludeMot(bool $value): self
51+
{
52+
$this->excludeMot = $value;
53+
54+
return $this;
55+
}
56+
57+
public function getExcludeWarranty(): bool
58+
{
59+
return $this->excludeWarranty;
60+
}
61+
62+
public function setExcludeWarranty(bool $value): self
63+
{
64+
$this->excludeWarranty = $value;
65+
66+
return $this;
67+
}
68+
69+
public function getExcludeInteriorDetails(): bool
70+
{
71+
return $this->excludeInteriorDetails;
72+
}
73+
74+
public function setExcludeInteriorDetails(bool $value): self
75+
{
76+
$this->excludeInteriorDetails = $value;
77+
78+
return $this;
79+
}
80+
81+
public function getExcludeTyreCondition(): bool
82+
{
83+
return $this->excludeTyreCondition;
84+
}
85+
86+
public function setExcludeTyreCondition(bool $value): self
87+
{
88+
$this->excludeTyreCondition = $value;
89+
90+
return $this;
91+
}
92+
93+
public function getExcludeBodyCondition(): bool
94+
{
95+
return $this->excludeBodyCondition;
96+
}
97+
98+
public function setExcludeBodyCondition(bool $value): self
99+
{
100+
$this->excludeBodyCondition = $value;
101+
102+
return $this;
103+
}
104+
105+
public function toArray(): array
106+
{
107+
return $this->filterPrepareOutput([
108+
'excludePreviousOwners' => $this->excludePreviousOwners,
109+
'excludeStrapline' => $this->excludeStrapline,
110+
'excludeMot' => $this->excludeMot,
111+
'excludeWarranty' => $this->excludeWarranty,
112+
'excludeInteriorDetails' => $this->excludeInteriorDetails,
113+
'excludeTyreCondition' => $this->excludeTyreCondition,
114+
'excludeBodyCondition' => $this->excludeBodyCondition,
115+
]);
116+
}
117+
}

src/Api/Builders/StockItemRetailAdvertsInfoBuilder.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ class StockItemRetailAdvertsInfoBuilder extends AbstractBuilder
2828

2929
protected $suppliedPrice;
3030

31+
protected $displayOptions;
32+
3133
public function __construct(array $attributes = [])
3234
{
3335
parent::__construct($attributes);
@@ -61,6 +63,10 @@ public function __construct(array $attributes = [])
6163
'Profile Advert',
6264
$this->dataGet($attributes, 'profileAdvert', [])
6365
);
66+
67+
$this->displayOptions = new StockItemRetailAdvertsDisplayOptionsBuilder(
68+
$this->dataGet($attributes, 'displayOptions', [])
69+
);
6470
}
6571

6672
public function setVatStatus($status): StockItemRetailAdvertsInfoBuilder
@@ -172,6 +178,7 @@ public function toArray(): array
172178
'locatorAdvert' => $this->locatorAdvert->toArray(),
173179
'exportAdvert' => $this->exportAdvert->toArray(),
174180
'profileAdvert' => $this->profileAdvert->toArray(),
181+
'displayOptions' => $this->displayOptions->toArray(),
175182
]);
176183
}
177184
}

0 commit comments

Comments
 (0)