Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

Implemented multiple labels ability. #186

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chvarkov
Copy link

@chvarkov chvarkov commented May 3, 2019

Added ability usage multiple labels.
See issue #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

@graphaware-bot
Copy link

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 cla@graphaware.com .

Thank you very much in advance,

Kind Regards,

The GraphAware Team

@ikwattro
Copy link
Member

ikwattro commented May 5, 2019

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 ?

@chvarkov
Copy link
Author

chvarkov commented May 7, 2019

@ikwattro
Oops. I need better research it.
Maybe you see solution?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants