I need to add a where clause to my DataObjectManager.
My existing code looks like this:
$fields->addFieldToTab('Root.Backgrounds', new ImageDataObjectManager(
$this->owner,
'BackgroundImages',
'BackgroundImage',
));
I have tried simply adding it like the below but it doesn't apply the filter and I always end up with all the BackgroundImages returned, not those with the required SubSiteID.
$fields->addFieldToTab('Root.Backgrounds', new ImageDataObjectManager(
$this->owner,
'BackgroundImages',
'BackgroundImage',
"'BackgroundImage.SiteConfigID' = '".$this->owner->SubsiteID."'"
));
Can someone tell me where I am going wrong please?