public array Result::getOverlay( string $categoryId , string $overlayId )
Retrieve an eContext API Category overlay array from a result object
Note
Your account must be setup to provide overlay results. Please contact sales@econtext.com for more information.
Returns an array representation of an eContext API overlay object
Echo the IAB overlay name for a single keyword, "abba hair care products"
$classify = new eContext\Classify\Keywords($client, ["abba hair care products"]);
$results = $classify->classify();
foreach($results->yieldResults() as $keywordResult) {
$categoryId = $keywordResult['category_id'];
$iabCategories = $results->getOverlay($categoryId, "iab2016");
echo "IAB categories are " . json_encode($iabCategories) . PHP_EOL;
}
The above code should output:
IAB categories are [["Style & Fashion","Beauty"]]