commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
OrderSearchRequestModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
16
21{
26 protected $query;
27
32 protected $sort;
33
38 protected $limit;
39
44 protected $offset;
45
46
50 public function __construct(
53 ?int $limit = null,
54 ?int $offset = null
55 ) {
56 $this->query = $query;
57 $this->sort = $sort;
58 $this->limit = $limit;
59 $this->offset = $offset;
60 }
61
68 public function getQuery()
69 {
70 if (is_null($this->query)) {
72 $data = $this->raw(self::FIELD_QUERY);
73 if (is_null($data)) {
74 return null;
75 }
76
77 $this->query = OrderSearchQueryModel::of($data);
78 }
79
80 return $this->query;
81 }
82
89 public function getSort()
90 {
91 if (is_null($this->sort)) {
93 $data = $this->raw(self::FIELD_SORT);
94 if (is_null($data)) {
95 return null;
96 }
97 $this->sort = OrderSearchSortingCollection::fromArray($data);
98 }
99
100 return $this->sort;
101 }
102
109 public function getLimit()
110 {
111 if (is_null($this->limit)) {
113 $data = $this->raw(self::FIELD_LIMIT);
114 if (is_null($data)) {
115 return null;
116 }
117 $this->limit = (int) $data;
118 }
119
120 return $this->limit;
121 }
122
129 public function getOffset()
130 {
131 if (is_null($this->offset)) {
133 $data = $this->raw(self::FIELD_OFFSET);
134 if (is_null($data)) {
135 return null;
136 }
137 $this->offset = (int) $data;
138 }
139
140 return $this->offset;
141 }
142
143
147 public function setQuery(?OrderSearchQuery $query): void
148 {
149 $this->query = $query;
150 }
151
156 {
157 $this->sort = $sort;
158 }
159
163 public function setLimit(?int $limit): void
164 {
165 $this->limit = $limit;
166 }
167
171 public function setOffset(?int $offset): void
172 {
173 $this->offset = $offset;
174 }
175}
__construct(?OrderSearchQuery $query=null, ?OrderSearchSortingCollection $sort=null, ?int $limit=null, ?int $offset=null)
static fromArray(array $data)