1792 Posts in 588 Topics by 560 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1204 Views |
-
searchcontext filter

17 January 2010 at 2:56am
Hi, ovo je moje prvo pitanje na ovom forumu
I'm using searchcontext logic for my search form but I have problem.
Code:
static $searchable_fields = array(
'Naziv' => 'PartialMatchFilter',
'Cat' => 'PartialMatchFilter',
'Mapid' => 'ExactMatchFilter',
);//////
function InfoResults($searchCriteria = array()) {
$request = ($this->request) ? $this->request : $this->parentController->getRequest();
if(!$searchCriteria) $searchCriteria = $request->requestVars();
$start = ($request->getVar('start')) ? (int)$request->getVar('start') : 0;
$limit = $this->stat('podataka_po_strani');
$context = singleton('Info')->getDefaultSearchContext();
$query = $context->getQuery($searchCriteria, null, array('start'=>$start,'limit'=>$limit));$records = $context->getResults($searchCriteria, null, array('start'=>$start,'limit'=>$limit));
if($records) {
$records->setPageLimits($start, $limit, $query->unlimitedRowCount());
}
return $records;
}Everything works well but How do I add a permanent filter in the results, regardless of the query such as "WHERE `Cat` NOT LIKE '%ulic%'"
Thanks for any hint!
-
Re: searchcontext filter

25 January 2010 at 12:35pm
Hm, either by prepopulating your search form (through HiddenField or default values for other formfields), or by modifying $searchCriteria in your controller code before invoking getResults()
| 1204 Views | ||
|
Page:
1
|
Go to Top |


