mirror of
https://github.com/moodle/moodle.git
synced 2025-08-11 11:56:40 +02:00
Merge branch 'MDL-81525-main' of https://github.com/andrewnicols/moodle
This commit is contained in:
commit
9966241efb
35 changed files with 127 additions and 204 deletions
|
@ -30,13 +30,13 @@ use stdClass;
|
|||
#[\core\attribute\label('Allows plugins or features to perform actions after a course is created.')]
|
||||
#[\core\attribute\tags('course')]
|
||||
class after_course_created {
|
||||
|
||||
/**
|
||||
* Constructor for the hook.
|
||||
*
|
||||
* @param stdClass $course The course instance.
|
||||
*/
|
||||
public function __construct(
|
||||
/** @var stdClass The course instance */
|
||||
public readonly stdClass $course,
|
||||
) {
|
||||
}
|
||||
|
|
|
@ -28,7 +28,6 @@ use stdClass;
|
|||
#[\core\attribute\label('Allows plugins or features to perform actions after a course is updated.')]
|
||||
#[\core\attribute\tags('course')]
|
||||
class after_course_updated {
|
||||
|
||||
/**
|
||||
* Constructor for the hook.
|
||||
*
|
||||
|
@ -37,8 +36,11 @@ class after_course_updated {
|
|||
* @param bool $changeincoursecat Whether the course category has changed.
|
||||
*/
|
||||
public function __construct(
|
||||
/** @var stdClass The course instance */
|
||||
public readonly stdClass $course,
|
||||
/** @var stdClass The old course instance */
|
||||
public readonly stdClass $oldcourse,
|
||||
/** @var bool Whether the course category has changed */
|
||||
public readonly bool $changeincoursecat = false,
|
||||
) {
|
||||
}
|
||||
|
|
|
@ -28,13 +28,10 @@ use Psr\EventDispatcher\StoppableEventInterface;
|
|||
*/
|
||||
#[\core\attribute\label('Allows plugins or features to perform actions before a course is deleted.')]
|
||||
#[\core\attribute\tags('course')]
|
||||
class before_course_delete implements
|
||||
StoppableEventInterface {
|
||||
|
||||
/**
|
||||
* @var bool Whether the propagation of this event has been stopped.
|
||||
*/
|
||||
protected bool $stopped = false;
|
||||
class before_course_deleted implements
|
||||
StoppableEventInterface
|
||||
{
|
||||
use \core\hook\stoppable_trait;
|
||||
|
||||
/**
|
||||
* Constructor for the hook.
|
||||
|
@ -42,18 +39,8 @@ class before_course_delete implements
|
|||
* @param stdClass $course The course instance.
|
||||
*/
|
||||
public function __construct(
|
||||
/** @var stdClass The course instance */
|
||||
public readonly stdClass $course,
|
||||
) {
|
||||
}
|
||||
|
||||
public function isPropagationStopped(): bool {
|
||||
return $this->stopped;
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop the propagation of this event.
|
||||
*/
|
||||
public function stop(): void {
|
||||
$this->stopped = true;
|
||||
}
|
||||
}
|
|
@ -34,7 +34,9 @@ class after_cm_name_edited implements described_hook {
|
|||
* @param string $newname the new name
|
||||
*/
|
||||
public function __construct(
|
||||
/** @var cm_info the course module */
|
||||
protected cm_info $cm,
|
||||
/** @var string the new name */
|
||||
protected string $newname,
|
||||
) {
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue