GraphAware\Reco4PHP\Result\Recommendations::getContext PHP Method

getContext() public method

public getContext ( ) : GraphAware\Reco4PHP\Context\Context
return GraphAware\Reco4PHP\Context\Context
    public function getContext() : Context
    {
        return $this->context;
    }

Usage Example

 private function doPostProcess(Node $input, Recommendations $recommendations, RecommendationEngine $engine)
 {
     $recommendations->getContext()->getStatistics()->startPostProcess();
     $postProcessResult = $this->postProcessExecutor->execute($input, $recommendations, $engine);
     foreach ($engine->getPostProcessors() as $postProcessor) {
         $tag = $postProcessor->name();
         $result = $postProcessResult->get($tag);
         $postProcessor->handleResultSet($input, $result, $recommendations);
     }
     $recommendations->getContext()->getStatistics()->stopPostProcess();
 }