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->getCollection()->getSelect()->where(
"sfop.additional_information like ?"
, '%column";s:'.strlen($value).':"%'.$value.'%');
break;
}
}
Any ideas are much appreciated...