Passed
Push — master ( 6221c1...b56763 )
by Mihail
05:30
created

AbstractSearchResult::getTitle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 1
eloc 2
c 1
b 1
f 0
nc 1
nop 0
dl 0
loc 4
rs 10
1
<?php
2
3
namespace Apps\Model\Front\Search;
4
5
6
use Ffcms\Core\Helper\Date;
7
8
/**
9
 * Class AbstractSearchResult. Static setter & getter instance to organize search result items.
10
 * Yes, i know it's a fully sh@t for php, but this is most useful when extending model should follow union format.
11
 * Maybe interface and __magic is better, you can suggest it on github ;)
12
 * @package Apps\Model\Front\Search
13
 */
14
class AbstractSearchResult
15
{
16
    protected $title;
17
    protected $snippet;
18
    protected $uri;
19
    protected $date;
20
    protected $relevance;
21
22
    /**
23
     * Set item title
24
     * @param string $value
25
     */
26
    public function setTitle($value)
27
    {
28
        $this->title = $value;
29
    }
30
31
    /**
32
     * Get item title
33
     * @return string|null
34
     */
35
    public function getTitle()
36
    {
37
        return $this->title;
38
    }
39
40
    /**
41
     * Set item snippet
42
     * @param string $value
43
     */
44
    public function setSnippet($value)
45
    {
46
        $this->snippet = $value;
47
    }
48
49
    /**
50
     * Get item snippet
51
     * @return string|null
52
     */
53
    public function getSnippet()
54
    {
55
        return $this->snippet;
56
    }
57
58
    /**
59
     * Set item uri path
60
     * @param string $value
61
     */
62
    public function setUri($value)
63
    {
64
        $this->uri = $value;
65
    }
66
67
    /**
68
     * Get item path
69
     * @return string
70
     */
71
    public function getUri()
72
    {
73
        return $this->uri;
74
    }
75
76
    /**
77
     * Set item date
78
     * @param string $value
79
     */
80
    public function setDate($value)
81
    {
82
        $this->date = Date::humanize($value);
83
    }
84
85
    /**
86
     * Get item date
87
     * @return string
88
     */
89
    public function getDate()
90
    {
91
        return $this->date;
92
    }
93
94
    /**
95
     * Set item relevance
96
     * @param int|float $value
97
     */
98
    public function setRelevance($value)
99
    {
100
        $this->relevance = $value;
101
    }
102
103
    /**
104
     * Get item relevance
105
     * @return float|int
106
     */
107
    public function getRelevance()
108
    {
109
        return $this->relevance;
110
    }
111
}