]> git.mxchange.org Git - friendica.git/blob - src/Repository/FSuggest.php
Merge pull request #9397 from vinzv/9238-red-color-unread-messages-faded
[friendica.git] / src / Repository / FSuggest.php
1 <?php
2 /**
3  * @copyright Copyright (C) 2020, Friendica
4  *
5  * @license GNU AGPL version 3 or any later version
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU Affero General Public License as
9  * published by the Free Software Foundation, either version 3 of the
10  * License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU Affero General Public License for more details.
16  *
17  * You should have received a copy of the GNU Affero General Public License
18  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
19  *
20  */
21
22 namespace Friendica\Repository;
23
24 use Friendica\BaseRepository;
25 use Friendica\Collection;
26 use Friendica\Model;
27
28 class FSuggest extends BaseRepository
29 {
30         protected static $table_name = 'fsuggest';
31
32         protected static $model_class = Model\FSuggest::class;
33
34         protected static $collection_class = Collection\FSuggests::class;
35
36         /**
37          * @param array $data
38          * @return Model\FSuggest
39          */
40         protected function create(array $data)
41         {
42                 return new Model\FSuggest($this->dba, $this->logger, $data);
43         }
44
45         /**
46          * Returns the Friend Suggest based on it's ID
47          *
48          * @param int $id The id of the fsuggest
49          *
50          * @return Model\FSuggest
51          *
52          * @throws \Friendica\Network\HTTPException\NotFoundException
53          */
54         public function getById(int $id)
55         {
56                 return $this->selectFirst(['id' => $id]);
57         }
58
59         /**
60          * @param array $condition
61          * @return Model\FSuggest
62          * @throws \Friendica\Network\HTTPException\NotFoundException
63          */
64         public function selectFirst(array $condition)
65         {
66                 return parent::selectFirst($condition);
67         }
68
69         /**
70          * @param array $condition
71          * @param array $params
72          * @return Collection\FSuggests
73          * @throws \Exception
74          */
75         public function select(array $condition = [], array $params = [])
76         {
77                 return parent::select($condition, $params);
78         }
79
80         /**
81          * @param array $condition
82          * @param array $params
83          * @param int|null $max_id
84          * @param int|null $since_id
85          * @param int $limit
86          * @return Collection\FSuggests
87          * @throws \Exception
88          */
89         public function selectByBoundaries(array $condition = [], array $params = [], int $max_id = null, int $since_id = null, int $limit = self::LIMIT)
90         {
91                 return parent::selectByBoundaries($condition, $params, $max_id, $since_id, $limit);
92         }
93 }