i currently have a DB setup that involves 2 classes defined by 2 tables and a many-to-many joining table.
CREATE TABLE IF NOT EXISTS `items` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(128) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `sections` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(128) NOT NULL,
PRIMARY KEY (`id`),
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `sections_items` (
`section_id` int(10) unsigned NOT NULL,
`item_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`section_id`,`photo_id`),
KEY `photo_id` (`photo_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
conceptually, i have a lot of *Item* objects that could be associated with multiple *Section* objects... so i would be able to say "Item *a* is /in/ Section *x* and also /in/ Section *y*"
my schema above functions fine. what I would like to do is to order the Items that are in Sections--ideally add a 3rd field 'order' to the *sections_items* table such that i could expect a certain order when i call $section->buildItems(). is there a way i could configure this using the ORM conventions in flourishlib?