Línea 67... |
Línea 67... |
67 |
*
|
67 |
*
|
68 |
* @param string $itemtype the type of the favourited items.
|
68 |
* @param string $itemtype the type of the favourited items.
|
69 |
* @param int $itemid the id of the item to which the favourites relate
|
69 |
* @param int $itemid the id of the item to which the favourites relate
|
70 |
* @param \context $context the context of the items which were favourited.
|
70 |
* @param \context $context the context of the items which were favourited.
|
71 |
*/
|
71 |
*/
|
72 |
public function delete_favourites_by_type_and_item(string $itemtype, int $itemid, \context $context = null) {
|
72 |
public function delete_favourites_by_type_and_item(string $itemtype, int $itemid, ?\context $context = null) {
|
73 |
$criteria = ['component' => $this->component, 'itemtype' => $itemtype, 'itemid' => $itemid] +
|
73 |
$criteria = ['component' => $this->component, 'itemtype' => $itemtype, 'itemid' => $itemid] +
|
74 |
($context ? ['contextid' => $context->id] : []);
|
74 |
($context ? ['contextid' => $context->id] : []);
|
75 |
$this->repo->delete_by($criteria);
|
75 |
$this->repo->delete_by($criteria);
|
76 |
}
|
76 |
}
|
77 |
}
|
77 |
}
|