I have this table:
CREATE TABLE `attributes` (
`id` int(10) unsigned NOT NULL auto_increment,
`controller` varchar(25) default NULL,
`category` varchar(25) NOT NULL,
`item` varchar(25) NOT NULL,
`value` varchar(50) NOT NULL,
`created` datetime default NULL,
`modified` datetime default NULL,
PRIMARY KEY (`id`)
)
//sample data
INSERT INTO `attributes` VALUES(1, 'Profiles', 'Basics', 'Lookingto',
'Friendship', '0000-00-00 00:00:00', '0000-00-00 00:00:00');
INSERT INTO `attributes` VALUES(2, 'Profiles', 'Basics', 'Lookingto',
'A Relationship', '0000-00-00 00:00:00', '0000-00-00 00:00:00');
INSERT INTO `attributes` VALUES(6, 'Profiles', 'Basics',
'Relationshipstatus', 'Single', '0000-00-00 00:00:00', '0000-00-00
00:00:00');
INSERT INTO `attributes` VALUES(7, 'Profiles', 'Basics',
'Relationshipstatus', 'Committed', '0000-00-00 00:00:00', '0000-00-00
00:00:00');
INSERT INTO `attributes` VALUES(11, 'Profiles', 'Basics', 'Bodytype',
'Slim', '0000-00-00 00:00:00', '0000-00-00 00:00:00');
INSERT INTO `attributes` VALUES(12, 'Profiles', 'Basics', 'Bodytype',
'Slender', '0000-00-00 00:00:00', '0000-00-00 00:00:00');
INSERT INTO `attributes` VALUES(72, 'Profiles', 'Lifestyle',
'Drinker', 'Yes', '0000-00-00 00:00:00', '0000-00-00 00:00:00');
INSERT INTO `attributes` VALUES(73, 'Profiles', 'Lifestyle',
'Drinker', 'No', '0000-00-00 00:00:00', '0000-00-00 00:00:00');
INSERT INTO `attributes` VALUES(74, 'Profiles', 'Lifestyle',
'Drinker', 'I will tell you later', '0000-00-00 00:00:00', '0000-00-00
00:00:00');
--> I do not like doing this:
$this->set('arr_attribute_idlookingTo',$this->Attribute-
>generateList(array('controller' => $this->name, 'category' =>
'Basics', 'item' => 'Lookingto'), 'id ASC', 0, '{n}.Attribute.id',
'{n}.Attribute.value'));
$this->set('arr_attribute_idrelationshipstatus',$this->Attribute-
>generateList(array('controller' => $this->name, 'category' =>
'Basics', 'item' => 'Relationshipstatus'), 'id ASC', 0,
'{n}.Attribute.id', '{n}.Attribute.value'));
$this->set('arr_attribute_idlifestyle',$this->Attribute-
>generateList(array('controller' => $this->name, 'category' =>
'Basics', 'item' => 'Lifestyle'), 'id ASC', 0, '{n}.Attribute.id',
'{n}.Attribute.value'));
I dont' like doing that because i am querying the database so many
times.
I'd rather do a findAll $condtions = array('controller' => $this-
>name)
and then somehow call the getFieldValue to do whatever it does
that takes keys and values out of the data from the findAll...
Can someone tell me how i can call getFieldValue and pass it the data
of interests ?
Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---