Neo4j-PHP-OGM icon indicating copy to clipboard operation
Neo4j-PHP-OGM copied to clipboard

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

Open cedriclevarlet opened this issue 10 years ago • 1 comments

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;

cedriclevarlet avatar Sep 10 '14 18:09 cedriclevarlet

Please submit a pull request request.

lphuberdeau avatar Sep 10 '14 19:09 lphuberdeau