Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Orm
Is it possible to set multiple ORM relations between two tables?
Jume
April 2013
Example. I have 2 ORM models:
- country with PK field ID
- order with two fields shipping_country_id and billing_country_id
Is there a way to set 2 belongs_to relations trough shipping_country_id and billing_country_id fields and get something like this:
$order->shipping_country->name
$order->billing_country->name
Harro
April 2013
Just define them like normal (i.e. the array notation), specifying the correct keys to make the link.
Jume
April 2013
Thanks Harro it works...
Add a Comment
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
5,089
General
↳ General
3,364
↳ Job Board
13
↳ Installation & Setup
214
Packages
↳ Oil
213
↳ Orm
700
↳ Auth
261
Development
↳ Tips and Tutorials
126
↳ Code share
145
↳ Applications
52
In this Discussion
Harro
April 2013
Jume
April 2013