neoxygen / neo4j-neoclient

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

getSingleRelationship() returns object, but relationship methods are not working on that object #41

Closed agoransson closed 9 years ago

agoransson commented 9 years ago

Hey, I'm having a very strange issue I think. The following code causes exceptions for me.

  $relationship = $node->getSingleRelationship('USES', 'OUT');
  return $relationship->getStartNode();

However, getting all the USES relationships works without trouble. I can't quite figure out why the single relationship wont work. Especially since the getSingleRelationship method overloads the getRelationships method.

    "error": {
      "type": "Symfony\\Component\\Debug\\Exception\\FatalErrorException",
      "message": "Call to a member function getStartNode() on a non-object",
      ...  
    }
agoransson commented 9 years ago

Turns out when I changed the create statement to create unique USES relationship it works.