jonathangeiger / kohana-jelly

See the link below for the most up-to-date code
https://github.com/creatoro/jelly
MIT License
146 stars 34 forks source link

Inheritance #130

Closed pundit closed 14 years ago

pundit commented 14 years ago

I would be great if relationship for inheritance could be as easy as any other relationship such as many-to-many and many-to-one.

I have been trying to stimulate this relationship for the longest while and can't seem to get it to work.

Good work! by the way. Keep it up

banks commented 14 years ago

Can you explain your problem a little more clearly? What do you mean by inheritance? Are you playing with the (experimental) polymorphism branch? Or do you mean you want polymorphic relationships but not polymorphic models?

This is a very complex topic (as you have found out) so we really aren't going to be able to understand your request/issue unless you explain it clearly!

pundit commented 14 years ago

hi banks, As i'm a novice at the kohana and jelly more specifically, I was hoping for a easy way to get the values of one table from another like a parent-child relationship. i have done it before using ORM where from the child class i declared a has_one relationship and i was able to access properties from the parent class. through the views. i was hoping to get something similar or even better than ORM.

i guess according to what u mention is probably the polymorhic models is what i'll trying to get at.

I hope this clears up what i am requesting.

banks commented 14 years ago

Hi pundit, sorry for the long delay - both of us are a little snowed under with other stuff at the minute.

Inheritance is what you really want here - it will be much easier when finished.

That said, what you are talking about is multi-table inheritance where the fields from one table are inherited in another. We are not planning to support this initially as it is much more complicated that single table inheritance.

You are still free to define has_one relationships just like you did in ORM though with very little downside. Eventually there will be a 'nice' way to do it but not just yet.

I'll close this for now as it is already in the plan. If you need more help with specifics on how to get this working in your models, post on the forums.