I am working on a subscription system. Users
subscribe to Activities
, but Activities
have Options
(different pricing options). So Users
are actually linked to Options
, with Subscriptions
acting as join table.
Activities
hasMany
Options
and Options
hasMany
Subscriptions
Now I often want a list of Subscriptions
for a specific activity, regardless of options. I found that
$activity = $this->Activities->get($id, ['contain' => 'Options.Subscriptions']);
...works well to get the options which in turn contain the subscriptions. How could go about omitting the Options
from the contain, such that only the Subscriptions
are found?