Hi Aaron,
To get partial string matching to work with the GetList() function,
you'll need to create a Filter function (similar to the Compare
functions that allows pog to sort objects). It should look like this:
function FilterList($objectList, $attributeToCompare, $value)
{
$filteredList = array();
foreach ($objectList as $object)
{
if (strpos($object->{$attributeToCompare}, $value))
{
$filteredList[] = $object;
}
}
return $filteredList;
}
Then you can call this function whenever you need to filter your object
list as follows:
$objectList = $objectList->FilterList($objectList, $attributeName,
$value);
However, what this means is that you'll first need to get the entire
object list (or a sublist using another condition) and *then* filter
it. I would suggest coding to accommodate for POG in this scenario, i.e
if you absolutely need partial string matching, then use another
condition to shorten the list.
This is, as you see, not very efficient at all, and that's why we
didn't put it in 1.6. It would have penalized GetList() to accomodate
partial string matching. I don't think there's a way to improve this
drastically, unless base64 is supported natively by mysql or any other
database....
I encourage anyone who might have a better solution to let us know.
But I hope this *patch* helps you get the job done.
Let me know.
Joel