2

I found today in slack neo4j that it is possible to use ogm in php.

https://github.com/graphaware/neo4j-php-ogm

I use the examples demonstrated in test folder with person and movie table.

But I want to have only 10 movies, but I now have all movies.

This is my code in application :

$movies = $em->getRepository(Personne::class)->findAll();

Thanks already for responses.

4

1 回答 1

3

哇,令人印象深刻,这个库是今天早上发布的。感谢您已经在使用它。

我假设您的问题中有错字,并且传递给实体管理器的类应该是电影类。

所以是的,这可以只返回所有电影节点的一个子集,甚至对它们进行排序:

$only10Movies = $em->getRepository(Movie::class)->findAll(['limit' => 10]);

如果需要,您也可以订购它们:

$movies = $em->getRepository(Movie::class)->findAll(['order' => array('title' => BaseRepository::ORDER_ASC)]);

该文档也可在此处获得:

https://github.com/graphaware/neo4j-php-ogm/blob/1.0/docs/01-intro.md

于 2016-05-25T21:42:51.367 回答