From c090391a558c4cf64ecce3805b1f18cf5b54f0b1 Mon Sep 17 00:00:00 2001 From: "ct-sdks[bot]" <153784748+ct-sdks[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 16:24:23 +0000 Subject: [PATCH] build(codegen): updating SDK --- changes.md | 3 + .../ProductSearchFacetResultStats.php | 88 +++++++ .../ProductSearchFacetResultStatsBuilder.php | 210 +++++++++++++++ ...roductSearchFacetResultStatsCollection.php | 56 ++++ .../ProductSearchFacetResultStatsModel.php | 248 ++++++++++++++++++ .../ProductSearchFacetStatsExpression.php | 30 +++ ...oductSearchFacetStatsExpressionBuilder.php | 73 ++++++ ...ctSearchFacetStatsExpressionCollection.php | 56 ++++ ...ProductSearchFacetStatsExpressionModel.php | 67 +++++ .../ProductSearchFacetStatsValue.php | 87 ++++++ .../ProductSearchFacetStatsValueBuilder.php | 191 ++++++++++++++ ...ProductSearchFacetStatsValueCollection.php | 56 ++++ .../ProductSearchFacetStatsValueModel.php | 213 +++++++++++++++ references.txt | 1 + 14 files changed, 1379 insertions(+) create mode 100644 lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetResultStats.php create mode 100644 lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetResultStatsBuilder.php create mode 100644 lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetResultStatsCollection.php create mode 100644 lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetResultStatsModel.php create mode 100644 lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsExpression.php create mode 100644 lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsExpressionBuilder.php create mode 100644 lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsExpressionCollection.php create mode 100644 lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsExpressionModel.php create mode 100644 lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsValue.php create mode 100644 lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsValueBuilder.php create mode 100644 lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsValueCollection.php create mode 100644 lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsValueModel.php diff --git a/changes.md b/changes.md index 90ff776cac8..370f019a8ba 100644 --- a/changes.md +++ b/changes.md @@ -297,6 +297,9 @@ - added type `PaymentSetMethodInfoCustomTypeAction` - added type `PaymentSetMethodInfoInterfaceAccountAction` - added type `PaymentSetMethodInfoTokenAction` +- added type `ProductSearchFacetResultStats` +- added type `ProductSearchFacetStatsExpression` +- added type `ProductSearchFacetStatsValue` - added type `ProductTailoringSetProductAttributeAction` - added type `AttributeLevelEnum` - added type `ProductSetProductAttributeAction` diff --git a/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetResultStats.php b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetResultStats.php new file mode 100644 index 00000000000..2932ddc1d16 --- /dev/null +++ b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetResultStats.php @@ -0,0 +1,88 @@ +The minimum value of the field, scoped to the faceted results.

+ * + + * @return null|mixed + */ + public function getMin(); + + /** + *

The maximum value of the field, scoped to the faceted results.

+ * + + * @return null|mixed + */ + public function getMax(); + + /** + *

The average value of the field calculated as sum / count.

+ *

Only returned for number fields.

+ * + + * @return null|mixed + */ + public function getMean(); + + /** + *

The sum of values of the field that match the facet expression.

+ *

Only returned for number fields.

+ * + + * @return null|mixed + */ + public function getSum(); + + /** + *

The total number of values counted that match the facet expression.

+ * + + * @return null|int + */ + public function getCount(); + + /** + * @param mixed $min + */ + public function setMin($min): void; + + /** + * @param mixed $max + */ + public function setMax($max): void; + + /** + * @param mixed $mean + */ + public function setMean($mean): void; + + /** + * @param mixed $sum + */ + public function setSum($sum): void; + + /** + * @param ?int $count + */ + public function setCount(?int $count): void; +} diff --git a/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetResultStatsBuilder.php b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetResultStatsBuilder.php new file mode 100644 index 00000000000..d13a0fdeaa3 --- /dev/null +++ b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetResultStatsBuilder.php @@ -0,0 +1,210 @@ + + */ +final class ProductSearchFacetResultStatsBuilder implements Builder +{ + /** + + * @var ?string + */ + private $name; + + /** + + * @var null|mixed|mixed + */ + private $min; + + /** + + * @var null|mixed|mixed + */ + private $max; + + /** + + * @var null|mixed|mixed + */ + private $mean; + + /** + + * @var null|mixed|mixed + */ + private $sum; + + /** + + * @var ?int + */ + private $count; + + /** + *

Name of the facet.

+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + *

The minimum value of the field, scoped to the faceted results.

+ * + + * @return null|mixed + */ + public function getMin() + { + return $this->min; + } + + /** + *

The maximum value of the field, scoped to the faceted results.

+ * + + * @return null|mixed + */ + public function getMax() + { + return $this->max; + } + + /** + *

The average value of the field calculated as sum / count.

+ *

Only returned for number fields.

+ * + + * @return null|mixed + */ + public function getMean() + { + return $this->mean; + } + + /** + *

The sum of values of the field that match the facet expression.

+ *

Only returned for number fields.

+ * + + * @return null|mixed + */ + public function getSum() + { + return $this->sum; + } + + /** + *

The total number of values counted that match the facet expression.

+ * + + * @return null|int + */ + public function getCount() + { + return $this->count; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + /** + * @param mixed $min + * @return $this + */ + public function withMin($min) + { + $this->min = $min; + + return $this; + } + + /** + * @param mixed $max + * @return $this + */ + public function withMax($max) + { + $this->max = $max; + + return $this; + } + + /** + * @param mixed $mean + * @return $this + */ + public function withMean($mean) + { + $this->mean = $mean; + + return $this; + } + + /** + * @param mixed $sum + * @return $this + */ + public function withSum($sum) + { + $this->sum = $sum; + + return $this; + } + + /** + * @param ?int $count + * @return $this + */ + public function withCount(?int $count) + { + $this->count = $count; + + return $this; + } + + + public function build(): ProductSearchFacetResultStats + { + return new ProductSearchFacetResultStatsModel( + $this->name, + $this->min, + $this->max, + $this->mean, + $this->sum, + $this->count + ); + } + + public static function of(): ProductSearchFacetResultStatsBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetResultStatsCollection.php b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetResultStatsCollection.php new file mode 100644 index 00000000000..f28aa28ebae --- /dev/null +++ b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetResultStatsCollection.php @@ -0,0 +1,56 @@ + + * @method ProductSearchFacetResultStats current() + * @method ProductSearchFacetResultStats end() + * @method ProductSearchFacetResultStats at($offset) + */ +class ProductSearchFacetResultStatsCollection extends ProductSearchFacetResultCollection +{ + /** + * @psalm-assert ProductSearchFacetResultStats $value + * @psalm-param ProductSearchFacetResultStats|stdClass $value + * @throws InvalidArgumentException + * + * @return ProductSearchFacetResultStatsCollection + */ + public function add($value) + { + if (!$value instanceof ProductSearchFacetResultStats) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?ProductSearchFacetResultStats + */ + protected function mapper() + { + return function (?int $index): ?ProductSearchFacetResultStats { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var ProductSearchFacetResultStats $data */ + $data = ProductSearchFacetResultStatsModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetResultStatsModel.php b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetResultStatsModel.php new file mode 100644 index 00000000000..d62505cc0ef --- /dev/null +++ b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetResultStatsModel.php @@ -0,0 +1,248 @@ +name = $name; + $this->min = $min; + $this->max = $max; + $this->mean = $mean; + $this->sum = $sum; + $this->count = $count; + } + + /** + *

Name of the facet.

+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + /** + *

The minimum value of the field, scoped to the faceted results.

+ * + * + * @return null|mixed + */ + public function getMin() + { + if (is_null($this->min)) { + /** @psalm-var mixed $data */ + $data = $this->raw(self::FIELD_MIN); + if (is_null($data)) { + return null; + } + $this->min = $data; + } + + return $this->min; + } + + /** + *

The maximum value of the field, scoped to the faceted results.

+ * + * + * @return null|mixed + */ + public function getMax() + { + if (is_null($this->max)) { + /** @psalm-var mixed $data */ + $data = $this->raw(self::FIELD_MAX); + if (is_null($data)) { + return null; + } + $this->max = $data; + } + + return $this->max; + } + + /** + *

The average value of the field calculated as sum / count.

+ *

Only returned for number fields.

+ * + * + * @return null|mixed + */ + public function getMean() + { + if (is_null($this->mean)) { + /** @psalm-var mixed $data */ + $data = $this->raw(self::FIELD_MEAN); + if (is_null($data)) { + return null; + } + $this->mean = $data; + } + + return $this->mean; + } + + /** + *

The sum of values of the field that match the facet expression.

+ *

Only returned for number fields.

+ * + * + * @return null|mixed + */ + public function getSum() + { + if (is_null($this->sum)) { + /** @psalm-var mixed $data */ + $data = $this->raw(self::FIELD_SUM); + if (is_null($data)) { + return null; + } + $this->sum = $data; + } + + return $this->sum; + } + + /** + *

The total number of values counted that match the facet expression.

+ * + * + * @return null|int + */ + public function getCount() + { + if (is_null($this->count)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_COUNT); + if (is_null($data)) { + return null; + } + $this->count = (int) $data; + } + + return $this->count; + } + + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } + + /** + * @param mixed $min + */ + public function setMin($min): void + { + $this->min = $min; + } + + /** + * @param mixed $max + */ + public function setMax($max): void + { + $this->max = $max; + } + + /** + * @param mixed $mean + */ + public function setMean($mean): void + { + $this->mean = $mean; + } + + /** + * @param mixed $sum + */ + public function setSum($sum): void + { + $this->sum = $sum; + } + + /** + * @param ?int $count + */ + public function setCount(?int $count): void + { + $this->count = $count; + } +} diff --git a/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsExpression.php b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsExpression.php new file mode 100644 index 00000000000..8c96db25b34 --- /dev/null +++ b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsExpression.php @@ -0,0 +1,30 @@ +Definition of the stats facet.

+ * + + * @return null|ProductSearchFacetStatsValue + */ + public function getStats(); + + /** + * @param ?ProductSearchFacetStatsValue $stats + */ + public function setStats(?ProductSearchFacetStatsValue $stats): void; +} diff --git a/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsExpressionBuilder.php b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsExpressionBuilder.php new file mode 100644 index 00000000000..c2b333b2529 --- /dev/null +++ b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsExpressionBuilder.php @@ -0,0 +1,73 @@ + + */ +final class ProductSearchFacetStatsExpressionBuilder implements Builder +{ + /** + + * @var null|ProductSearchFacetStatsValue|ProductSearchFacetStatsValueBuilder + */ + private $stats; + + /** + *

Definition of the stats facet.

+ * + + * @return null|ProductSearchFacetStatsValue + */ + public function getStats() + { + return $this->stats instanceof ProductSearchFacetStatsValueBuilder ? $this->stats->build() : $this->stats; + } + + /** + * @param ?ProductSearchFacetStatsValue $stats + * @return $this + */ + public function withStats(?ProductSearchFacetStatsValue $stats) + { + $this->stats = $stats; + + return $this; + } + + /** + * @deprecated use withStats() instead + * @return $this + */ + public function withStatsBuilder(?ProductSearchFacetStatsValueBuilder $stats) + { + $this->stats = $stats; + + return $this; + } + + public function build(): ProductSearchFacetStatsExpression + { + return new ProductSearchFacetStatsExpressionModel( + $this->stats instanceof ProductSearchFacetStatsValueBuilder ? $this->stats->build() : $this->stats + ); + } + + public static function of(): ProductSearchFacetStatsExpressionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsExpressionCollection.php b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsExpressionCollection.php new file mode 100644 index 00000000000..47725b74ca1 --- /dev/null +++ b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsExpressionCollection.php @@ -0,0 +1,56 @@ + + * @method ProductSearchFacetStatsExpression current() + * @method ProductSearchFacetStatsExpression end() + * @method ProductSearchFacetStatsExpression at($offset) + */ +class ProductSearchFacetStatsExpressionCollection extends ProductSearchFacetExpressionCollection +{ + /** + * @psalm-assert ProductSearchFacetStatsExpression $value + * @psalm-param ProductSearchFacetStatsExpression|stdClass $value + * @throws InvalidArgumentException + * + * @return ProductSearchFacetStatsExpressionCollection + */ + public function add($value) + { + if (!$value instanceof ProductSearchFacetStatsExpression) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?ProductSearchFacetStatsExpression + */ + protected function mapper() + { + return function (?int $index): ?ProductSearchFacetStatsExpression { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var ProductSearchFacetStatsExpression $data */ + $data = ProductSearchFacetStatsExpressionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsExpressionModel.php b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsExpressionModel.php new file mode 100644 index 00000000000..7b54910f027 --- /dev/null +++ b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsExpressionModel.php @@ -0,0 +1,67 @@ +stats = $stats; + } + + /** + *

Definition of the stats facet.

+ * + * + * @return null|ProductSearchFacetStatsValue + */ + public function getStats() + { + if (is_null($this->stats)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STATS); + if (is_null($data)) { + return null; + } + + $this->stats = ProductSearchFacetStatsValueModel::of($data); + } + + return $this->stats; + } + + + /** + * @param ?ProductSearchFacetStatsValue $stats + */ + public function setStats(?ProductSearchFacetStatsValue $stats): void + { + $this->stats = $stats; + } +} diff --git a/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsValue.php b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsValue.php new file mode 100644 index 00000000000..608bd69b238 --- /dev/null +++ b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsValue.php @@ -0,0 +1,87 @@ +Name of the stats facet to appear in the ProductSearchFacetResultStats.

+ * + + * @return null|string + */ + public function getName(); + + /** + *

Whether the facet must consider only the Products resulting from the search (query) or all the Products (all).

+ * + + * @return null|string + */ + public function getScope(); + + /** + *

Additional filtering expression to apply to the search result before calculating the facet.

+ * + + * @return null|SearchQuery + */ + public function getFilter(); + + /** + *

The searchable Product field to facet on.

+ * + + * @return null|string + */ + public function getField(); + + /** + *

If the field is not standard, this must be the Attribute type.

+ * + + * @return null|string + */ + public function getFieldType(); + + /** + * @param ?string $name + */ + public function setName(?string $name): void; + + /** + * @param ?string $scope + */ + public function setScope(?string $scope): void; + + /** + * @param ?SearchQuery $filter + */ + public function setFilter(?SearchQuery $filter): void; + + /** + * @param ?string $field + */ + public function setField(?string $field): void; + + /** + * @param ?string $fieldType + */ + public function setFieldType(?string $fieldType): void; +} diff --git a/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsValueBuilder.php b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsValueBuilder.php new file mode 100644 index 00000000000..1b67abb5153 --- /dev/null +++ b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsValueBuilder.php @@ -0,0 +1,191 @@ + + */ +final class ProductSearchFacetStatsValueBuilder implements Builder +{ + /** + + * @var ?string + */ + private $name; + + /** + + * @var ?string + */ + private $scope; + + /** + + * @var null|SearchQuery|SearchQueryBuilder + */ + private $filter; + + /** + + * @var ?string + */ + private $field; + + /** + + * @var ?string + */ + private $fieldType; + + /** + *

Name of the stats facet to appear in the ProductSearchFacetResultStats.

+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + *

Whether the facet must consider only the Products resulting from the search (query) or all the Products (all).

+ * + + * @return null|string + */ + public function getScope() + { + return $this->scope; + } + + /** + *

Additional filtering expression to apply to the search result before calculating the facet.

+ * + + * @return null|SearchQuery + */ + public function getFilter() + { + return $this->filter instanceof SearchQueryBuilder ? $this->filter->build() : $this->filter; + } + + /** + *

The searchable Product field to facet on.

+ * + + * @return null|string + */ + public function getField() + { + return $this->field; + } + + /** + *

If the field is not standard, this must be the Attribute type.

+ * + + * @return null|string + */ + public function getFieldType() + { + return $this->fieldType; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + /** + * @param ?string $scope + * @return $this + */ + public function withScope(?string $scope) + { + $this->scope = $scope; + + return $this; + } + + /** + * @param ?SearchQuery $filter + * @return $this + */ + public function withFilter(?SearchQuery $filter) + { + $this->filter = $filter; + + return $this; + } + + /** + * @param ?string $field + * @return $this + */ + public function withField(?string $field) + { + $this->field = $field; + + return $this; + } + + /** + * @param ?string $fieldType + * @return $this + */ + public function withFieldType(?string $fieldType) + { + $this->fieldType = $fieldType; + + return $this; + } + + /** + * @deprecated use withFilter() instead + * @return $this + */ + public function withFilterBuilder(?SearchQueryBuilder $filter) + { + $this->filter = $filter; + + return $this; + } + + public function build(): ProductSearchFacetStatsValue + { + return new ProductSearchFacetStatsValueModel( + $this->name, + $this->scope, + $this->filter instanceof SearchQueryBuilder ? $this->filter->build() : $this->filter, + $this->field, + $this->fieldType + ); + } + + public static function of(): ProductSearchFacetStatsValueBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsValueCollection.php b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsValueCollection.php new file mode 100644 index 00000000000..f67b0cbf4af --- /dev/null +++ b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsValueCollection.php @@ -0,0 +1,56 @@ + + * @method ProductSearchFacetStatsValue current() + * @method ProductSearchFacetStatsValue end() + * @method ProductSearchFacetStatsValue at($offset) + */ +class ProductSearchFacetStatsValueCollection extends MapperSequence +{ + /** + * @psalm-assert ProductSearchFacetStatsValue $value + * @psalm-param ProductSearchFacetStatsValue|stdClass $value + * @throws InvalidArgumentException + * + * @return ProductSearchFacetStatsValueCollection + */ + public function add($value) + { + if (!$value instanceof ProductSearchFacetStatsValue) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?ProductSearchFacetStatsValue + */ + protected function mapper() + { + return function (?int $index): ?ProductSearchFacetStatsValue { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var ProductSearchFacetStatsValue $data */ + $data = ProductSearchFacetStatsValueModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsValueModel.php b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsValueModel.php new file mode 100644 index 00000000000..7f822eabff0 --- /dev/null +++ b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsValueModel.php @@ -0,0 +1,213 @@ +name = $name; + $this->scope = $scope; + $this->filter = $filter; + $this->field = $field; + $this->fieldType = $fieldType; + } + + /** + *

Name of the stats facet to appear in the ProductSearchFacetResultStats.

+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + /** + *

Whether the facet must consider only the Products resulting from the search (query) or all the Products (all).

+ * + * + * @return null|string + */ + public function getScope() + { + if (is_null($this->scope)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SCOPE); + if (is_null($data)) { + return null; + } + $this->scope = (string) $data; + } + + return $this->scope; + } + + /** + *

Additional filtering expression to apply to the search result before calculating the facet.

+ * + * + * @return null|SearchQuery + */ + public function getFilter() + { + if (is_null($this->filter)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_FILTER); + if (is_null($data)) { + return null; + } + + $this->filter = SearchQueryModel::of($data); + } + + return $this->filter; + } + + /** + *

The searchable Product field to facet on.

+ * + * + * @return null|string + */ + public function getField() + { + if (is_null($this->field)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_FIELD); + if (is_null($data)) { + return null; + } + $this->field = (string) $data; + } + + return $this->field; + } + + /** + *

If the field is not standard, this must be the Attribute type.

+ * + * + * @return null|string + */ + public function getFieldType() + { + if (is_null($this->fieldType)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->fieldType = (string) $data; + } + + return $this->fieldType; + } + + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } + + /** + * @param ?string $scope + */ + public function setScope(?string $scope): void + { + $this->scope = $scope; + } + + /** + * @param ?SearchQuery $filter + */ + public function setFilter(?SearchQuery $filter): void + { + $this->filter = $filter; + } + + /** + * @param ?string $field + */ + public function setField(?string $field): void + { + $this->field = $field; + } + + /** + * @param ?string $fieldType + */ + public function setFieldType(?string $fieldType): void + { + $this->fieldType = $fieldType; + } +} diff --git a/references.txt b/references.txt index 1711cc7886e..51f32e02afa 100644 --- a/references.txt +++ b/references.txt @@ -463,3 +463,4 @@ c12d33dda145602c607dcf1bb77f503f4508a1ee 3bbf481773bfe2658556d3072d111455e4c7025f aa465ddc60683d2befa938584d2d88fa054cc5cb 5c92f154265d21fff776730b17f7c6f27cbfdcb7 +cd07396232802b1c29238fb92214946462f19e5d