Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
SearchService
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 3
12
0.00% covered (danger)
0.00%
0 / 1
 getSearchImplementation
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setSearchImplementation
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 runIndexing
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3/**
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; under version 2
7 * of the License (non-upgradable).
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17 *
18 * Copyright (c) 2014 (original work) Open Assessment Technologies SA;
19 *
20 *
21 */
22
23namespace oat\tao\model\search;
24
25use oat\tao\model\menu\MenuService;
26use oat\oatbox\service\ServiceManager;
27use oat\tao\model\search\index\IndexIterator;
28use oat\tao\model\search\index\IndexService;
29
30/**
31 * Search service
32 *
33 * @author Joel Bout <joel@taotesting.com>
34 * @deprecated
35 */
36class SearchService
37{
38    public const CONFIG_KEY = 'search';
39
40    /**
41     * @return Search
42     */
43    public static function getSearchImplementation()
44    {
45        return ServiceManager::getServiceManager()->get(Search::SERVICE_ID);
46    }
47
48    /**
49     * Store the search implementation to use
50     *
51     * @param Search $impl
52     */
53    public static function setSearchImplementation(Search $impl)
54    {
55        return ServiceManager::getServiceManager()->register(Search::SERVICE_ID, $impl);
56    }
57
58    /**
59     * Runs a full reindexing of the resources
60     *
61     * @return int nr of resources indexed
62     */
63    public static function runIndexing()
64    {
65        $indexService = ServiceManager::getServiceManager()->get(IndexService::SERVICE_ID);
66        return $indexService->runIndexing();
67    }
68}