2010-12-11 11 views

答えて

1

市モデル

class City extends AppModel{ 
     var name = "City"; 
     var $primaryKey = "objid"; 
     var $belongsTo = array('Country' => array('className' => 'Country','foreignKey' =>'country_id')); 
    } 

郡モデル

class Country extends AppModel{ 
    var name = "Country"; 
    var $primaryKey = "objid"; 
    var $hasMany = array('City'); 
} 
+0

それは動作します。ありがとう – Adnan