public function doPostProcess(NodeInterface $input, Recommendation $recommendation, RecordCursorInterface $result) { if (count($result->records()) === 0 || !$result->getRecord()->hasValues()) { return; } $recommendation->add(new PartialScore(1, $this->name())); }
public function doPostProcess(NodeInterface $input, Recommendation $recommendation, RecordCursorInterface $result) { if ($result->getRecord()->value('degree') <= 0) { return; } $recommendation->addScore($this->name(), new SingleScore(-($result->getRecord()->value('degree') / 100))); }
public function doPostProcess(NodeInterface $input, Recommendation $recommendation, RecordCursorInterface $result) { if (count($result->records()) > 0) { foreach ($result->records() as $record) { $recommendation->addScore(new Score(1, $this->name())); } } }
public function postProcess(NodeInterface $input, Recommendation $recommendation, RecordCursorInterface $result = null) { $record = $result->getRecord(); if ($rating = $record->value("ratings")) { if ($rating > 10) { $recommendation->addScore($this->name(), new SingleScore($rating)); } } }
public function postProcess(NodeInterface $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)); } } }