I'm using neo4jphp and performing following query using \Everyman\Neo4j\Cypher\Query
"MATCH (p:Person) OPTIONAL MATCH (p)-[:CITIZEN]->(c:Country) RETURN p, c ";
I can get properties of Person
$props = $row['x']->getProperties();
How can I get country of the person? printing $row I can see country field, but I couldn't find methods in the docs and sources.
Row objects implement the ArrayAccess interface, so can be accessed like arrays. Assuming from your query that the row has properties 'p' for the Person and 'c' for the Country, you can access the country node object like: