Jump to:

7940 Posts in 1543 Topics by 946 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Input type of sourcefilter/setSourceFilter

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 852 Views
  • Martijn
    Community Member
    271 Posts

    Input type of sourcefilter/setSourceFilter Link to this post


    I want to use DataObjectManager as a ResultsTable in ModelAdmin.

    This works fine, until I close the popup, then the all the items returns in the TableList without applying my ModelAdmin searchcriteria.

    I tried to use $tf->setSoureFilter($filter); , but I need to convert the ResultAssembly from ModelAdmin to a format that DOM can pick up after the refresh.

    In the method loadSourceFilter() there is this part:

    if(!empty($this->filter)) {
             $break = strpos($this->filter, "_");
             $field = substr($this->filter, 0, $break);
             $value = substr($this->filter, $break+1, strlen($this->filter) - strlen($field));
             $filter_string = $field . "='$value'";

    But I don't quite understand what the input needs to be.

    The format of the querystring from ModelAdmin is like this:


    What's the correct input for DataObjectManager->setSourceFilter($filter); so I can convert the ModelAdmin ResultsAssembly to a DataObjectManager format?

    Thanks in advance.

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.