Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUESTION] X-To-Many Relationships #8

Open
ElGigi opened this issue Feb 6, 2019 · 2 comments
Open

[QUESTION] X-To-Many Relationships #8

ElGigi opened this issue Feb 6, 2019 · 2 comments

Comments

@ElGigi
Copy link
Contributor

ElGigi commented Feb 6, 2019

Hi,

I would like to know how manage X-To-Many relationships with Atlas.Transit.

Example :

  • Article: a class who represent an article (table: article)
  • Tag: a class who represent a tag (table: tag)
  • article_tag: a table to make relationship between article and tag tables, and to have multiple tags for one article

The idea would be to have a method : Article::getTags() who returns a collection of tags. When we persist the article object, the associates tags would be save in relationship table.

It's possible with the current beta? Or that's needs development?

Regards,
Ronan

@pmjones
Copy link
Contributor

pmjones commented Feb 6, 2019

Hi @ElGigi -- you should be able to do that right now, provided you have the most-recent Atlas releases; see, for example, the TransitTest::testAggregate() method, where tags get loaded up into a collection.

@pmjones
Copy link
Contributor

pmjones commented Feb 6, 2019

As a side note, please remember that Transit has not even had an alpha release yet. It is still under development, though I do try to make 0.x releases when I commit major changes.

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

No branches or pull requests

2 participants