neoxygen / neo4j-neoclient

Simple PHP HttpClient for the Neo4j ReST API with Multi DB Support
MIT License
121 stars 138 forks source link

Getting node by Label with node having multiple labels from Path #12

Closed Mulkave closed 9 years ago

Mulkave commented 9 years ago

This issue might not be specific to Paths but to getNodesByLabel($label)

Consider this code:

// create related nodes
$q = 'CREATE (u:`User`:`Person` {name: {name}, email: {email}})-[:HAS]->(p:`Phone` {code: {code}, number: {number}}) RETURN u';
$params = ['name' => 'Abed Halawi', 'email' => 'halawi.abed@gmail.com', 'code' => 123, 'number' => 8612358];
$response = $client->sendCypherQuery($q, $params, null, array('graph'));

// find path
$pathResponse = $client->getPathbetween($start, $end);
$path = $formatter->format($pathResponse);

// get specific nodes
$path->getNodesByLabel('User:Person') // null
current($path->getNodesByLabel('User'))->getLabel(); // User
current($path->getNodesByLabel('Person'))->getLabel(); // User
current($path->getNodesByLabel('Phone'))->getLabel(); // Phone
ikwattro commented 9 years ago

:+1:

ikwattro commented 9 years ago

Fixed in 2.0