im trying to access data stored on a pivot table with no success...
My tables and Models are these:
*Countries
-id
-name
-code_name
-active
*Sites
-id
-season_id
-title
-active
Countries_Sites:
-country_id
-site_id
-year
class Site_Model extends ORM {
protected $has_and_belongs_to_many = array('countries');
}
class Country_Model extends ORM {
protected $has_and_belongs_to_many = array('sites');
}
I wonder if there is a builtin method or something to access the "year" value of the pivot table.
Thanks!
You need a has_many "through" relationship. see here: http://docs.kohanaphp.com/libraries/orm/advanced#has_many_through_relationships