| Total Complexity | 10 |
| Total Lines | 96 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | class AbstractSearchResult |
||
| 14 | { |
||
| 15 | protected $title; |
||
| 16 | protected $snippet; |
||
| 17 | protected $uri; |
||
| 18 | protected $date; |
||
| 19 | protected $relevance; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Set item title |
||
| 23 | * @param string $value |
||
| 24 | */ |
||
| 25 | public function setTitle($value) |
||
| 26 | { |
||
| 27 | $this->title = $value; |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Get item title |
||
| 32 | * @return string|null |
||
| 33 | */ |
||
| 34 | public function getTitle() |
||
| 35 | { |
||
| 36 | return $this->title; |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Set item snippet |
||
| 41 | * @param string $value |
||
| 42 | */ |
||
| 43 | public function setSnippet($value) |
||
| 44 | { |
||
| 45 | $this->snippet = $value; |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Get item snippet |
||
| 50 | * @return string|null |
||
| 51 | */ |
||
| 52 | public function getSnippet() |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * Set item uri path |
||
| 59 | * @param string $value |
||
| 60 | */ |
||
| 61 | public function setUri($value) |
||
| 62 | { |
||
| 63 | $this->uri = $value; |
||
| 64 | } |
||
| 65 | |||
| 66 | /** |
||
| 67 | * Get item path |
||
| 68 | * @return string |
||
| 69 | */ |
||
| 70 | public function getUri() |
||
| 73 | } |
||
| 74 | |||
| 75 | /** |
||
| 76 | * Set item date |
||
| 77 | * @param string $value |
||
| 78 | */ |
||
| 79 | public function setDate($value) |
||
| 80 | { |
||
| 81 | $this->date = Date::humanize($value); |
||
| 82 | } |
||
| 83 | |||
| 84 | /** |
||
| 85 | * Get item date |
||
| 86 | * @return string |
||
| 87 | */ |
||
| 88 | public function getDate() |
||
| 89 | { |
||
| 90 | return $this->date; |
||
| 91 | } |
||
| 92 | |||
| 93 | /** |
||
| 94 | * Set item relevance |
||
| 95 | * @param int|float $value |
||
| 96 | */ |
||
| 97 | public function setRelevance($value) |
||
| 98 | { |
||
| 99 | $this->relevance = $value; |
||
| 100 | } |
||
| 101 | |||
| 102 | /** |
||
| 103 | * Get item relevance |
||
| 104 | * @return float|int |
||
| 105 | */ |
||
| 106 | public function getRelevance() |
||
| 109 | } |
||
| 110 | } |
||
| 111 |