The favourite_repository interface, defining the basic CRUD operations for favourite type items within core_favourites.
More...
|
| add (favourite $item) |
| Add one item to this repository.
|
|
| add_all (array $items) |
| Add all the items in the list to this repository.
|
|
| count () |
| Return the total number of items in this repository.
|
|
| count_by (array $criteria) |
| Return the number of favourites matching the specified criteria.
|
|
| delete (int $id) |
| Delete an item by id.
|
|
| delete_by (array $criteria) |
| Delete all favourites matching the specified criteria.
|
|
| exists (int $id) |
| Check whether an item exists in this repository, based on its id.
|
|
| exists_by (array $criteria) |
| Check whether an item exists in this repository, based on the specified criteria.
|
|
| find (int $id) |
| Find an item in this repository based on its id.
|
|
| find_all (int $limitfrom=0, int $limitnum=0) |
| Find all items in this repository.
|
|
| find_by (array $criteria, int $limitfrom=0, int $limitnum=0) |
| Find all items with attributes matching certain values.
|
|
| find_favourite (int $userid, string $component, string $itemtype, int $itemid, int $contextid) |
| Find a single favourite, based on it's unique identifiers.
|
|
| update (favourite $item) |
| Update an item within this repository.
|
|
The favourite_repository interface, defining the basic CRUD operations for favourite type items within core_favourites.
◆ add()
core_favourites\local\repository\favourite_repository_interface::add |
( |
favourite | $item | ) |
|
◆ add_all()
core_favourites\local\repository\favourite_repository_interface::add_all |
( |
array | $items | ) |
|
◆ count()
core_favourites\local\repository\favourite_repository_interface::count |
( |
| ) |
|
◆ count_by()
core_favourites\local\repository\favourite_repository_interface::count_by |
( |
array | $criteria | ) |
|
◆ delete()
core_favourites\local\repository\favourite_repository_interface::delete |
( |
int | $id | ) |
|
◆ delete_by()
core_favourites\local\repository\favourite_repository_interface::delete_by |
( |
array | $criteria | ) |
|
◆ exists()
core_favourites\local\repository\favourite_repository_interface::exists |
( |
int | $id | ) |
|
◆ exists_by()
core_favourites\local\repository\favourite_repository_interface::exists_by |
( |
array | $criteria | ) |
|
Check whether an item exists in this repository, based on the specified criteria.
- Parameters
-
array | $criteria | the list of key/value criteria pairs. |
- Return values
-
bool | true if the favourite exists, false otherwise. |
Implemented in core_favourites\local\repository\favourite_repository.
◆ find()
core_favourites\local\repository\favourite_repository_interface::find |
( |
int | $id | ) |
|
◆ find_all()
core_favourites\local\repository\favourite_repository_interface::find_all |
( |
int | $limitfrom = 0, |
|
|
int | $limitnum = 0 ) |
Find all items in this repository.
- Parameters
-
int | $limitfrom | optional pagination control for returning a subset of records, starting at this point. |
int | $limitnum | optional pagination control for returning a subset comprising this many records. |
- Return values
-
array | list of all items in this repository. |
Implemented in core_favourites\local\repository\favourite_repository.
◆ find_by()
core_favourites\local\repository\favourite_repository_interface::find_by |
( |
array | $criteria, |
|
|
int | $limitfrom = 0, |
|
|
int | $limitnum = 0 ) |
Find all items with attributes matching certain values.
- Parameters
-
array | $criteria | the array of attribute/value pairs. |
int | $limitfrom | optional pagination control for returning a subset of records, starting at this point. |
int | $limitnum | optional pagination control for returning a subset comprising this many records. |
- Return values
-
array | the list of items matching the criteria. |
Implemented in core_favourites\local\repository\favourite_repository.
◆ find_favourite()
core_favourites\local\repository\favourite_repository_interface::find_favourite |
( |
int | $userid, |
|
|
string | $component, |
|
|
string | $itemtype, |
|
|
int | $itemid, |
|
|
int | $contextid ) |
Find a single favourite, based on it's unique identifiers.
- Parameters
-
int | $userid | the id of the user to which the favourite belongs. |
string | $component | the frankenstyle component name. |
string | $itemtype | the type of the favourited item. |
int | $itemid | the id of the item which was favourited (not the favourite's id). |
int | $contextid | the contextid of the item which was favourited. |
- Return values
-
Implemented in core_favourites\local\repository\favourite_repository.
◆ update()
core_favourites\local\repository\favourite_repository_interface::update |
( |
favourite | $item | ) |
|
The documentation for this interface was generated from the following file:
- favourites/classes/local/repository/favourite_repository_interface.php