Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 6 |
|
0.00% |
0 / 4 |
CRAP | |
0.00% |
0 / 1 |
| IndexProperty | |
0.00% |
0 / 6 |
|
0.00% |
0 / 4 |
20 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| getField | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| isFuzzy | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| isDefault | |
0.00% |
0 / 1 |
|
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) 2018 (original work) Open Assessment Technologies SA; |
| 19 | */ |
| 20 | |
| 21 | namespace oat\tao\model\search\index; |
| 22 | |
| 23 | /** |
| 24 | * Class IndexProperty |
| 25 | * @package oat\tao\model\search\index |
| 26 | */ |
| 27 | class IndexProperty |
| 28 | { |
| 29 | /** @var string */ |
| 30 | protected $field; |
| 31 | |
| 32 | /** @var boolean */ |
| 33 | protected $fuzzy; |
| 34 | |
| 35 | /** @var boolean */ |
| 36 | protected $default; |
| 37 | |
| 38 | /** |
| 39 | * IndexProperty constructor. |
| 40 | * @param $field |
| 41 | * @param bool $fuzzy |
| 42 | * @param bool $default |
| 43 | * @throws \common_Exception |
| 44 | */ |
| 45 | public function __construct( |
| 46 | $field, |
| 47 | $fuzzy = false, |
| 48 | $default = false |
| 49 | ) { |
| 50 | $this->field = $field; |
| 51 | $this->fuzzy = $fuzzy; |
| 52 | $this->default = $default; |
| 53 | } |
| 54 | |
| 55 | /** |
| 56 | * @return string |
| 57 | */ |
| 58 | public function getField() |
| 59 | { |
| 60 | return $this->field; |
| 61 | } |
| 62 | |
| 63 | /** |
| 64 | * @return bool |
| 65 | */ |
| 66 | public function isFuzzy() |
| 67 | { |
| 68 | return (bool) $this->fuzzy; |
| 69 | } |
| 70 | |
| 71 | /** |
| 72 | * @return bool |
| 73 | */ |
| 74 | public function isDefault() |
| 75 | { |
| 76 | return (bool) $this->default; |
| 77 | } |
| 78 | } |