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

Implemented multiple labels ability.#186

Open
chvarkov wants to merge 1 commit into
graphaware:masterfrom
chvarkov:fix/issue-54
Open

Implemented multiple labels ability.#186
chvarkov wants to merge 1 commit into
graphaware:masterfrom
chvarkov:fix/issue-54

Conversation

@chvarkov

@chvarkov chvarkov commented May 3, 2019

Copy link
Copy Markdown

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
Copy Markdown

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

ikwattro commented May 5, 2019

Copy link
Copy Markdown
Member

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

chvarkov commented May 7, 2019

Copy link
Copy Markdown
Author

@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