/** * Search for bookmarks based on where condition * * @param string $where the where string * @param array $values the values to create the prepared request * @param boolean $paginate wether the result should use pagination (optional) * * @return the list of matching bookmark objects */ public static function getWhere($where, $values, $paginate = false) { $q = Doctrine_Query::create()->from('Herisson\\Model\\WpHerissonBookmarks b')->leftJoin('b.WpHerissonTags t')->where($where); if ($paginate) { $pagination = Pagination::i()->getVars(); $q->limit($pagination['limit'])->offset($pagination['offset']); } $bookmarks = $q->execute($values); return $bookmarks; }
/** * Get a WpHerissonLocalbackups list with where condition * * @param string $where the sql condition * @param array $data the value parameters * * @return an array of matching WpHerissonLocalbackups */ public static function getWhere($where, $data = array()) { $pagination = Pagination::i()->getVars(); $backups = Doctrine_Query::create()->from('Herisson\\Model\\WpHerissonLocalbackups')->where($where)->limit($pagination['limit'])->offset($pagination['offset'])->execute($data); return $backups; }
/** * Action to search a keyword through bookmarks * * @return void */ function searchAction() { $search = get('search'); $this->view->bookmarks = WpHerissonBookmarksTable::getSearch($search, true); $this->view->countAll = sizeof(WpHerissonBookmarksTable::getSearch($search)); $this->view->subtitle = __("Search results for « " . esc_html($search) . " »"); $this->view->pagination = Pagination::i()->getVars(); $this->setView('index'); }