I would like to know how to query a column for all or part of a string. I have created a module which uses data additional_information column from the Sales_Flat_Order_Payment table which I have been able to unserialize and display in a grid. However, when serching/filtering this column the user has to enter the full value which can be time consuming so I would like to filter using ANY value.

At the moment my filter is setup using strlen but I would like to know if there is a better way for me to do it please?

  protected function _paymentFilter($collection, $column)
    {
                case "additional_information_column":
                {

                    $this-&gt;getCollection()-&gt;getSelect()-&gt;where(
                        "sfop.additional_information like ?"
                        , '%column";s:'.strlen($value).':"%'.$value.'%');
                    break;
                }
    }


Any ideas are much appreciated...


Question: Where is the Apex URL builder?
Answer: This capability is available using the PageReference class. You can use the same mechanism to build query strings or parse the parameters out of one, without loops and a whole lotta script statements.

Parse an RFC 3986 URL query string

String query = '?password=Hunter2dog%26cat&amp;username=user%40example.com';

System.PageReference pageReference = new System.PageReference('/' + query);
Map&lt;String,String&gt; parameters = pageReference.getParameters();

String password = parameters.get('password'); //Hunter2dog&amp;cat
String username = parameters.get('username'); //user@example.com


Build an RFC 3986 URL query string

Map&lt;String,String&gt; parameters = new Map&lt;String,String&gt;{
  'password' =&gt; 'Hunter2dog&amp;cat',
  'username' =&gt; 'user@example.com'
};

System.PageReference pageReference = new System.PageReference('');
pageReference.getParameters().putAll(parameters);

String query = pageReference.getUrl();
//?password=Hunter2dog%26cat&amp;username=user%40example.com


http://www.ietf.org/rfc/rfc3986.txt