関連するモデルに条件を適用すると、cakephpのfindメソッドに問題があります。これが私のシナリオです
Machine belongsTo Category
Machine hasAndBelongsToMany Products
(機械で製造された製品)
今、私は特定の製品を持っている、そしてそれに属するマシンでそれらすべてのカテゴリーが欲しいです。
つまり、結果セットは次の配列のようになります。
Category 1
Machine 1 (that can produce for example product1)
machine 2 (that can produce product 1)
Category 2
machine 3 (that can produce product 1)
machine 4 (that can produce product 1)
私は封じ込め可能な振る舞いと参加を試みましたが、運がありません。