2012-10-23から1日間の記事一覧

hasmanyのテーブルに対して条件を設定する方法

del_flg = 0のhasmanyテーブルを取得したい例 $this->[モデル名]->hasMany['関連モデル名']['conditions'] = '関連モデル名.del_flag = 0'; $data = $this->[モデル名]->findAll()) foreachを使えば、hasMany 内のテーブルが増えても大丈夫 foreach ($this->…