GraphAware\Reco4PHP\Tests\Integration\Model\FriendsEngine::discoveryQuery PHP Méthode

discoveryQuery() public méthode

public discoveryQuery ( GraphAware\Common\Type\Node $input, GraphAware\Reco4PHP\Context\Context $context ) : GraphAware\Common\Cypher\StatementInterface
$input GraphAware\Common\Type\Node
$context GraphAware\Reco4PHP\Context\Context
Résultat GraphAware\Common\Cypher\StatementInterface
    public function discoveryQuery(Node $input, Context $context) : StatementInterface
    {
        $query = 'MATCH (n) WHERE id(n) = {id}
        MATCH (n)-[:FRIEND]->(friend)-[:FRIEND]->(reco)
        WHERE NOT (n)-[:FRIEND]->(reco)
        RETURN reco, count(*) as score';
        return Statement::prepare($query, ['id' => $input->identity()]);
    }