GraphAware\Reco4PHP\Post\RewardSomethingShared::postProcess PHP Метод

postProcess() публичный Метод

public postProcess ( GraphAware\Common\Type\Node $input, Recommendation $recommendation, GraphAware\Common\Result\RecordCursorInterface $result = null )
$input GraphAware\Common\Type\Node
$recommendation GraphAware\Reco4PHP\Result\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));
            }
        }
    }