public postProcess ( GraphAware\Common\Type\Node $input, |
||
$input | GraphAware\Common\Type\Node | |
$recommendation | ||
$result | GraphAware\Common\Result\RecordCursorInterface |
public function postProcess(Node $input, Recommendation $recommendation, RecordCursorInterface $result = null)
{
if (null === $result) {
throw new \RuntimeException(sprintf('Expected a non-null result in %s::postProcess()', get_class($this)));
}
if (count($result->records()) > 0) {
foreach ($result->records() as $record) {
$recommendation->addScore($this->name(), new SingleScore(1));
}
}
}