]> git.mxchange.org Git - friendica.git/blob - src/Repository/FSuggest.php
Merge pull request #8250 from annando/issue-8233
[friendica.git] / src / Repository / FSuggest.php
1 <?php
2
3 namespace Friendica\Repository;
4
5 use Friendica\BaseRepository;
6 use Friendica\Collection;
7 use Friendica\Model;
8
9 class FSuggest extends BaseRepository
10 {
11         protected static $table_name = 'fsuggest';
12
13         protected static $model_class = Model\FSuggest::class;
14
15         protected static $collection_class = Collection\FSuggests::class;
16
17         /**
18          * @param array $data
19          * @return Model\FSuggest
20          */
21         protected function create(array $data)
22         {
23                 return new Model\FSuggest($this->dba, $this->logger, $data);
24         }
25
26         /**
27          * Returns the Friend Suggest based on it's ID
28          *
29          * @param int $id The id of the fsuggest
30          *
31          * @return Model\FSuggest
32          *
33          * @throws \Friendica\Network\HTTPException\NotFoundException
34          */
35         public function getById(int $id)
36         {
37                 return $this->selectFirst(['id' => $id]);
38         }
39
40         /**
41          * @param array $condition
42          * @return Model\FSuggest
43          * @throws \Friendica\Network\HTTPException\NotFoundException
44          */
45         public function selectFirst(array $condition)
46         {
47                 return parent::selectFirst($condition);
48         }
49
50         /**
51          * @param array $condition
52          * @param array $params
53          * @return Collection\FSuggests
54          * @throws \Exception
55          */
56         public function select(array $condition = [], array $params = [])
57         {
58                 return parent::select($condition, $params);
59         }
60
61         /**
62          * @param array $condition
63          * @param array $params
64          * @param int|null $max_id
65          * @param int|null $since_id
66          * @param int $limit
67          * @return Collection\FSuggests
68          * @throws \Exception
69          */
70         public function selectByBoundaries(array $condition = [], array $params = [], int $max_id = null, int $since_id = null, int $limit = self::LIMIT)
71         {
72                 return parent::selectByBoundaries($condition, $params, $max_id, $since_id, $limit);
73         }
74 }