Vinelab / NeoEloquent

The Neo4j OGM for Laravel
MIT License
634 stars 200 forks source link

Builder find method. #135

Closed heydavid713 closed 8 years ago

heydavid713 commented 8 years ago

Hey guys,

In Vinelab\NeoEloquent\Builder.php the find method has the following lines.

// If the dev did not specify the $id as an int it would break
// so we cast it anyways.
if (is_array($id))
{
     return $this->findMany(array_map(function($id){ return (int) $id; }, $id), $properties);
}

It (obviously) is not working when the primary key is set to a string. I can removed and tested it working, but is there a reason (maybe in Neo4J) why this was done?

I'm using 1.2.11

heydavid713 commented 8 years ago

Ok I ran some more tests and found out why it was being casted to int. Changed it to check if it is a number first.