3 * @copyright Copyright (C) 2020, Friendica
5 * @license GNU AGPL version 3 or any later version
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.
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.
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/>.
22 namespace Friendica\Repository;
24 use Friendica\BaseRepository;
25 use Friendica\Collection;
28 class FSuggest extends BaseRepository
30 protected static $table_name = 'fsuggest';
32 protected static $model_class = Model\FSuggest::class;
34 protected static $collection_class = Collection\FSuggests::class;
38 * @return Model\FSuggest
40 protected function create(array $data)
42 return new Model\FSuggest($this->dba, $this->logger, $data);
46 * Returns the Friend Suggest based on it's ID
48 * @param int $id The id of the fsuggest
50 * @return Model\FSuggest
52 * @throws \Friendica\Network\HTTPException\NotFoundException
54 public function getById(int $id)
56 return $this->selectFirst(['id' => $id]);
60 * @param array $condition
61 * @return Model\FSuggest
62 * @throws \Friendica\Network\HTTPException\NotFoundException
64 public function selectFirst(array $condition)
66 return parent::selectFirst($condition);
70 * @param array $condition
71 * @param array $params
72 * @return Collection\FSuggests
75 public function select(array $condition = [], array $params = [])
77 return parent::select($condition, $params);
81 * @param array $condition
82 * @param array $params
83 * @param int|null $max_id
84 * @param int|null $since_id
86 * @return Collection\FSuggests
89 public function selectByBoundaries(array $condition = [], array $params = [], int $max_id = null, int $since_id = null, int $limit = self::LIMIT)
91 return parent::selectByBoundaries($condition, $params, $max_id, $since_id, $limit);