Hi!
First of all...thank you for this wonderful un-framework! :-) It's very usable for me.
I have a problem with a one-to-many relationship. I'm no sure if i just don't understand how it works or if it's another problem. I have 2 tables (simplified):
CREATE TABLE `basic_img_profiles` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`description` varchar(100) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `basic_images` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `fk_basic_images_basic_img_profiles_id` (`basic_img_profiles_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
ALTER TABLE `basic_images`
ADD CONSTRAINT `fk_basic_images_basic_img_profiles_id` FOREIGN KEY (`basic_img_profiles_id`) REFERENCES `basic_img_profiles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
and i have the classes with the override-tag:
fORM::mapClassToTable('ImageProfile', 'basic_img_profiles');
class ImageProfile extends fActiveRecord {}
fORM::mapClassToTable('Image', 'basic_images');
class Image extends fActiveRecord {}
If i'm loading images over a profile, everything works fine:
$p = new ImageProfile (1);
$p->buildImages ();
But if i try to associate an image to a profile, flourish says 'The table basic_img_profiles is not in a *-to-manyrelationship with the table basic_images':
$p = new ImageProfile (1);
$i = new Image ();
$i->setName ("BlaBla");
$p->associateImage ($img);
Is it wrong what i'm trying to do? I'm a little bit confused at the moment.
Thanks for your help! Ben