protected function parseFacets($jsonObject, ModelFactoryInterface $factory) { if (isset($jsonObject->categories)) { $this->categories = $factory->createCategoriesFacets($jsonObject->categories); unset($jsonObject->categories); } if (isset($jsonObject->prices)) { $this->priceRanges = $factory->createPriceRanges($jsonObject->prices); unset($jsonObject->prices); } if (isset($jsonObject->sale)) { $this->saleCounts = $factory->createSaleFacet($jsonObject->sale); unset($jsonObject->sale); } if (isset($jsonObject->new_in_since_date)) { $this->newInCounts = $factory->createNewInFacets($jsonObject->new_in_since_date); unset($jsonObject->new_in_since_date); } if (isset($jsonObject->product_facets)) { $this->productFacets = $factory->createProductFacets($jsonObject->product_facets); unset($jsonObject->product_facets); } $this->facets = $factory->createFacetsCounts($jsonObject); unset($jsonObject->facets); }