種のモデルは、私はちょうどprint_r($species)
、それは内部のサンプル値を示した場合、すべてのサンプルは、1種は500
$species= Species::model()->with('samples')->findAll(array('condition'=>'tax_id = :no','params'=>array(':no'=>$taxno)));
print_r($species);
$samples=$species->samples; //error here
print_r($samples);
に属し取得したい
public function relations()
{
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
'samples' => array(self::HAS_MANY, 'Sample', 'species_id'),
);
}
含まれています。しかし、それは$samples
に$samples=$species->samples;
で渡すことはできませんそれはerror 500
を示しています。
を提出しますか? – aslawin
あなたはテーブル構造を投稿することができます。 –