cluelessnoob Posted August 17, 2009 Share Posted August 17, 2009 I'm trying to create a page for organizing comic books. One table needs to have multiple hasone relations and I can't figure out how to do it. Any help would be appreciated. Here's what I have so far: <? class Comic extends AppModel { var $name = 'Comic'; var $belongsTo = array('User'); var $hasOne = array('Artist'), array('Author'), array('Rating'), array('Publisher'); } ?> Link to comment https://forums.phpfreaks.com/topic/170601-cakephp-multiple-hasone-relations-issue/ Share on other sites More sharing options...
jcombs_31 Posted August 17, 2009 Share Posted August 17, 2009 Just add the other models to your $hasOne array. You are trying to add multiple arrays which is incorrect. It is not even a correct array structure. var $hasOne = array('Artist', 'Model2', 'Model3'); Link to comment https://forums.phpfreaks.com/topic/170601-cakephp-multiple-hasone-relations-issue/#findComment-900075 Share on other sites More sharing options...
cluelessnoob Posted August 18, 2009 Author Share Posted August 18, 2009 Thanx that worked. Link to comment https://forums.phpfreaks.com/topic/170601-cakephp-multiple-hasone-relations-issue/#findComment-900572 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.