多层ORM如何在cakephp中运行?

I have the following structure:

  • Order ---- (hasMany) ----> Carton, Shoe
  • Carton --- (belongsTo) --> Order
  • Carton --- (hasMany) ----> Shoe
  • Shoe ----- (belongsTo) --> Order, Carton

So Order --> Carton --> Shoe

When saving data to the database Order is fine, Carton is fine, but Shoe only gets the "carton_id" set correctly, "the order_id" is null. Is there any way to make this work?

Also when I want to list all the shoes belonging to a particular order (without using order_id) How can I find all shoes which belong to a carton which belongs to a specific order?