Пример #1
0
 /**
  * Save search
  *
  * @method post
  * @route /search/bookmark
  */
 public function bookmarkAction()
 {
     $saveSuccess = false;
     $error = '';
     $params = $this->getParams();
     try {
         SearchRepository::saveSearch($params['route'], $params['label'], $params['searchText'], 1);
         $saveSuccess = true;
     } catch (Exception $e) {
     }
     $this->router->response()->json(array('success' => $saveSuccess, 'error' => $error));
 }
 public function testUpdateSearch()
 {
     $updateSearch = array('route' => '/test/route', 'label' => 'test search', 'searchText' => 'host:test service:disk');
     SearchRepository::saveSearch($updateSearch['route'], $updateSearch['label'], $updateSearch['searchText']);
     $this->tableEqualsXml('cfg_searches', dirname(__DIR__) . '/data/search.update.xml');
 }