7921 Posts in 1359 Topics by 933 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » Adding "where" clause to new DataObjectManager
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 272 Views |
-
Adding "where" clause to new DataObjectManager

6 July 2012 at 4:32pm
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?
| 272 Views | ||
|
Page:
1
|
Go to Top |

