neo4j-php-ogm
neo4j-php-ogm copied to clipboard
Implemented multiple labels ability.
Added ability usage multiple labels. See issue https://github.com/graphaware/neo4j-php-ogm/issues/54 Example of usage:
/**
* @OGM\Node(labels={"Person"})
*/
class Person
{
}
/**
* @OGM\Node(labels={"Student", "Person"})
*/
class Student extends Person
{
}
/**
* @OGM\Node(labels={"Worker", "Person"})
*/
class Worker extends Person
{
}
// Returns an array of Person from nodes (:Person)
$this->em->getRepository(Person::class)->findAll();
// Returns an array of Student from nodes (:Student:Person)
$this->em->getRepository(Student::class)->findAll();
// Returns an array of Student from nodes (:Worker:Person)
$this->em->getRepository(Worker::class)->findAll(); // Returns an array of Worker
Dear @chvarkov,
thank you very much for your Github contributions to GraphAware's software. In order for us to be able to accept and keep your contributions, we would like to ask you to download, fill in, sign, and send us a photo / scanned copy of the attached Contributor License Agreement to [email protected] .
Thank you very much in advance,
Kind Regards,
The GraphAware Team
Thanks @chvarkov
This looks great ! One small question, in the case of a class with 2 labels, let's say Student and Person, and an index in the database on Person only, are the queries optimized to make use of the index ?
@ikwattro Oops. I need better research it. Maybe you see solution?