/** * Converts the custom Entity returned by the API into a plain * associative array suitable for use with the custom Products post * type. This completely hides the details of the API results from * the WP plugin. * * @param \Swader\Diffbot\Entity\Product $product The returned Product entity from which to extract values. * @return object */ protected function map_product_fields_oldlib(\Swader\Diffbot\Entity\Product $product) { return ['title' => $product->getTitle(), 'text' => $product->getText(), 'offer_price' => $product->getOfferPrice(), 'regular_price' => $product->getRegularPrice(), 'source_url' => $product->getPageUrl()]; }