0
我試圖做一個非常簡單的CakePHP找到使用中可容納的行爲:的CakePHP中可容納:模型「比較」是不是與模型「比較」相關
$comp = $this->Comp->find('first', array(
'conditions' => array('Comp.id' => $id),
'contain' => array(
'Comp.id' => array(
'fields' => array('Comp.id'),
),
'Slot' => array(
'fields' => array(
'Slot.start_time',
'Slot.end_time'
)
),
'Team'
)
));
...但在執行時會顯示警告信息:
警告(512):型號 「小樣」 並不 與模型 「小樣」 [CORE /蛋糕/庫/模型/行爲/ containable.php, 線363]相關聯
我比較模式的開始如下:
var $name = 'Comp';
var $hasMany = array('Team', 'Round', 'Match');
var $belongsTo = array('Generation');
var $hasAndBelongsToMany = array('Slot');
var $actsAs = array('Containable');
我使用CakePHP 1.3.6
任何想法可能會導致什麼呢?
非常感謝!我不認爲要保持根模型的字段分離。 – Ben 2011-01-20 02:47:26