public function init() { $hasMaxRecordLimit = ($this->getMaxRecordLimit() !== false); $maxRecordLimit = $this->getMaxRecordLimit(); $hits = sfLuceneableToolkit::getHits($this->model, $this->search); $count = count($hits); $this->setNbResults($hasMaxRecordLimit ? min($count, $maxRecordLimit) : $count); if (($this->getPage() == 0 || $this->getMaxPerPage() == 0)) { $this->setLastPage(0); } else { $this->setLastPage(ceil($this->getNbResults() / $this->getMaxPerPage())); } $this->results = $hits; }
public function find($limit = 10) { $hits = sfLuceneableToolkit::getHits($this->_model, $this->_queryString); return PropelQuery::from($this->_model)->findPks($hits); }