Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Relations between models and stores #44

Closed
lmartins opened this issue Jun 16, 2018 · 2 comments
Closed

Relations between models and stores #44

lmartins opened this issue Jun 16, 2018 · 2 comments

Comments

@lmartins
Copy link

Looking at the documentation on Overriding and Extending I couldn't quite understand that in a situation where we need extra models, how can we have those be in relation with the respective store.

That is, lets say I have a model "Accessories", which can be linked to products from the current store. I'm assuming that we need to have something in that model that for each row in the database we can relate to the relevant store so that we can query all "Accessories" from that store for example.

Thank you!

@gnikyt
Copy link
Owner

gnikyt commented Jun 16, 2018

It's completely up to what you need. Would be rare to override or extend the shop model but you can definitely relate it to something. Maybe you're building a store locator and need the stores table to reference the shop in a one to many.

@lmartins
Copy link
Author

Oh I see, it makes sense. I was just wondering if I was missing a trait or some sort of mechanism that would treat every model in context to whatever would be the store consuming the API. Thanks for the clarification Tyler!

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

No branches or pull requests

2 participants