]> git.mxchange.org Git - friendica.git/blob - src/Object/Search/ResultList.php
Move mod/dirfind to src/Module/DirFind
[friendica.git] / src / Object / Search / ResultList.php
1 <?php
2
3 namespace Friendica\Object\Search;
4
5 use Friendica\Model\Search;
6
7 /**
8  * A list of search results with details
9  *
10  * @see Search for details
11  */
12 class ResultList
13 {
14         /**
15          * Page of the result list
16          * @var int
17          */
18         private $page;
19         /**
20          * Total count of results
21          * @var int
22          */
23         private $total;
24         /**
25          * items per page
26          * @var int
27          */
28         private $itemsPage;
29         /**
30          * Array of results
31          * @var Result[]
32          */
33         private $results;
34
35         /**
36          * @return int
37          */
38         public function getPage()
39         {
40                 return $this->page;
41         }
42
43         /**
44          * @return int
45          */
46         public function getTotal()
47         {
48                 return $this->total;
49         }
50
51         /**
52          * @return int
53          */
54         public function getItemsPage()
55         {
56                 return $this->itemsPage;
57         }
58
59         /**
60          * @return Result[]
61          */
62         public function getResults()
63         {
64                 return $this->results;
65         }
66
67         /**
68          * @param int      $page
69          * @param int      $total
70          * @param int      $itemsPage
71          * @param Result[] $results
72          */
73         public function __construct($page = 0, $total = 0, $itemsPage = 0, array $results = [])
74         {
75                 $this->page      = $page;
76                 $this->total     = $total;
77                 $this->itemsPage = $itemsPage;
78
79                 $this->results = $results;
80         }
81
82         /**
83          * Adds a result to the result list
84          *
85          * @param Result $result
86          */
87         public function addResult(Result $result)
88         {
89                 $this->results[] = $result;
90         }
91 }