私は以下の3つのモデルProduct
,Order
,OrderDetail
を持っています。Find()コンテナを使用するディープアソシエーションの条件
Product
には、以下の関連性を持っている:
public $hasMany = array('OrderDetail');
Order
には、以下の関連性を持っている:
public $hasMany = array('OrderDetail');
OrderDetail
には、以下の団体があります。
public $belongsTo = array('Order');
public $belongsTo = array('Product');
私はContainable
振る舞いを使用していますが、 wアリへfind()
製品。
find()コールの条件部分でOrder
モデルのフィールドを使用するにはどうすればよいですか?私Product
モデルでは、このような
何か:
$this->find('all', array('
conditions' => array(
'Order.order_date' => '2011-09-12'
)
));
これは動作しません、Order.order_dateが条件で使用することはできません。 – freshest