Hi,
I have a group of pages -A- which has a $has_many relation to a set of DataObjects -B-.
I am in a nested loop showing all of the -B- objects which are associated with each -A-.
Now, -B- also has a $belongs_many_many relation to another page type -C- (which in turn has a $many_many relation to -B-).
Do I have access to the set of -C- objects associated with each -B- in the loop in any way? Would make sense that I would, I just can't figure out how I would refer to that in the template. I am trying to avoid writing a custom query and I can't pass an ID back to the PHP from the template.
-A-:
class Service extends Page {
static $has_many = array(
"SubServices" => "SubService"
);
-B-:
class SubService extends DataObject {
static $has_one = array(
"Service" => "Service"
);
static $belongs_many_many = array(
"CaseStudy" => "CaseStudy"
);
-C-:
class CaseStudy extends Page {
static $many_many = array(
"SubServices" => "SubService"
);
Guidance would be appreciated. I've never had this exact kind of data relation before.
Thanks,
Garrett