lphuberdeau / Neo4j-PHP-OGM

A doctrine2 style library to access neo4j graphs
156 stars 45 forks source link

Repository.php __call returns throw when no nodes are found! #83

Open cedriclevarlet opened 10 years ago

cedriclevarlet commented 10 years ago

As the title says the current implementation of the __call method throws the following:

new InvalidArgumentException('Method name must begin with "findBy" or "findOneBy"!');

This happens whenever a findBy or findOneBy is called and no node is found. Whilst this could be intended I do not think this is intuitive and is in fact quite misleading.

I have replaced this implementation the following lines as it seems to be more logical.

} else { throw new InvalidArgumentException('Method name must begin with "findBy" or "findOneBy"!'); } return null;

lphuberdeau commented 10 years ago

Please submit a pull request request.