I paste bellow the code I have currently working (1.2 beta2). Not exactly what I wanted too but it is the best I could figure.
It applies both filters independently and in a cumulative way, delivering both the results with keyword X AND OR anything within the categories checked.
Implying also that to return just the results with keyword "X" no categories should be checked by the user.
BTW, the "Always return TRUE if no filter is given" part given in the documentation <
http://code.google.com/p/porpoise/wiki/Filters> no longer seems to work. Using that code, if nothing is given in the filters nothing is returned. Alternatively, one can get around it by specifying the layer to have all categories check by default.
I do hope someone more knowledgeable can shed some light here.
<?php
class MyPOIConnector extends SQLPOIConnector {
public function passesFilter(POI $poi, Filter $filter = NULL) {
if (in_array($poi->icon->type, $filter->checkboxlist)) {
return TRUE;
}
if (stripos($poi->text->title, $filter->searchbox1) !== FALSE) {
return TRUE;
}
if (stripos($poi->text->description, $filter->searchbox1) !== FALSE) {
return TRUE;
}
if (stripos($poi->text->footnote, $filter->searchbox1) !== FALSE) {
return TRUE;
}
return FALSE;