MDL-63658 core_favourites: adding paging support to the service layer
[moodle.git] / favourites / classes / local / repository / ifavourites_repository.php
CommitLineData
d4e98ee5
JD
1<?php
2// This file is part of Moodle - http://moodle.org/
3//
4// Moodle is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// Moodle is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
16/**
17 * Contains the favourites_repository interface.
18 *
19 * @package core_favourites
20 * @copyright 2018 Jake Dallimore <jrhdallimore@gmail.com>
21 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
22 */
4a02aae5 23namespace core_favourites\local\repository;
d4e98ee5
JD
24
25defined('MOODLE_INTERNAL') || die();
26
27/**
28 * The favourites_repository interface, defining additional operations useful to favourites type repositories.
29 *
30 * @copyright 2018 Jake Dallimore <jrhdallimore@gmail.com>
31 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
32 */
33interface ifavourites_repository extends crud_repository {
34 /**
35 * Find a single favourite, based on it's unique identifiers.
36 *
37 * @param int $userid the id of the user to which the favourite belongs.
38 * @param string $component the frankenstyle component name.
39 * @param string $itemtype the type of the favourited item.
40 * @param int $itemid the id of the item which was favourited (not the favourite's id).
41 * @param int $contextid the contextid of the item which was favourited.
42 * @return \stdClass the favourite.
43 */
44 public function find_favourite(int $userid, string $component, string $itemtype, int $itemid, int $contextid) : \stdClass;
45}