MDL-45319 events: trivial changes

This commit is contained in:
Mark Nelson 2014-05-02 16:39:40 -07:00 committed by Marina Glancy
parent eaea796e70
commit e687396a1e
36 changed files with 44 additions and 55 deletions

View File

@ -25,8 +25,6 @@ namespace core\event;
defined('MOODLE_INTERNAL') || die();
/**
* blog_association_created
*
* Class for event to be triggered when a new blog entry is associated with a context.
*
* @property-read array $other {

View File

@ -26,7 +26,7 @@ namespace core\event;
defined('MOODLE_INTERNAL') || die();
/**
* The blog comment created event.
* The blog comment created event class.
*
* @package core
* @since Moodle 2.7

View File

@ -26,7 +26,7 @@ namespace core\event;
defined('MOODLE_INTERNAL') || die();
/**
* The blog comment deleted event.
* The blog comment deleted event class.
*
* @package core
* @since Moodle 2.7

View File

@ -85,7 +85,7 @@ class cohort_created extends base {
/**
* Return legacy event data.
*
* @return stdClass
* @return \stdClass
*/
protected function get_legacy_eventdata() {
return $this->get_record_snapshot('cohort', $this->objectid);

View File

@ -85,7 +85,7 @@ class cohort_deleted extends base {
/**
* Return legacy event data.
*
* @return stdClass
* @return \stdClass
*/
protected function get_legacy_eventdata() {
return $this->get_record_snapshot('cohort', $this->objectid);

View File

@ -86,7 +86,7 @@ class cohort_member_added extends base {
/**
* Return legacy event data.
*
* @return stdClass
* @return \stdClass
*/
protected function get_legacy_eventdata() {
$data = new \stdClass();

View File

@ -87,7 +87,7 @@ class cohort_member_removed extends base {
/**
* Return legacy event data.
*
* @return stdClass
* @return \stdClass
*/
protected function get_legacy_eventdata() {
$data = new \stdClass();

View File

@ -85,7 +85,7 @@ class cohort_updated extends base {
/**
* Return legacy event data.
*
* @return stdClass
* @return \stdClass
*/
protected function get_legacy_eventdata() {
return $this->get_record_snapshot('cohort', $this->objectid);

View File

@ -86,7 +86,7 @@ class course_category_deleted extends base {
/**
* Returns the legacy event data.
*
* @return coursecat the category that was deleted
* @return \coursecat the category that was deleted
*/
protected function get_legacy_eventdata() {
return $this->coursecat;

View File

@ -15,7 +15,7 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Course content_deleted event class.
* Course content deleted event.
*
* @package core
* @copyright 2013 Mark Nelson <markn@moodle.com>
@ -27,7 +27,7 @@ namespace core\event;
defined('MOODLE_INTERNAL') || die();
/**
* Course content_deleted event class.
* Course content deleted event class.
*
* @property-read array $other {
* Extra information about event.

View File

@ -106,12 +106,12 @@ class course_user_report_viewed extends \core\event\base {
}
if (empty($this->relateduserid)) {
throw new \coding_exception('relateduserid needs to be set.');
throw new \coding_exception('The \'relateduserid\' must be set.');
}
// Make sure this class is never used without proper object details.
if (!isset($this->other['mode'])) {
throw new \coding_exception('mode needs to be set in $other.');
throw new \coding_exception('The \'mode\' value must be set in other.');
}
}
}

View File

@ -81,13 +81,13 @@ class email_failed extends base {
protected function validate_data() {
parent::validate_data();
if (!isset($this->other['subject'])) {
throw new \coding_exception('The subject needs to be set in $other');
throw new \coding_exception('The \'subject\' value must be set in other.');
}
if (!isset($this->other['message'])) {
throw new \coding_exception('The message needs to be set in $other');
throw new \coding_exception('The \'message\' value must be set in other.');
}
if (!isset($this->other['errorinfo'])) {
throw new \coding_exception('The error info needs to be set in $other');
throw new \coding_exception('The \'errorinfo\' value must be set in other.');
}
}
}

View File

@ -47,7 +47,7 @@ class group_created extends base {
/**
* Legacy event data if get_legacy_eventname() is not empty.
*
* @return stdClass
* @return \stdClass
*/
protected function get_legacy_eventdata() {
return $this->get_record_snapshot('groups', $this->objectid);

View File

@ -47,7 +47,7 @@ class group_deleted extends base {
/**
* Legacy event data if get_legacy_eventname() is not empty.
*
* @return stdClass
* @return \stdClass
*/
protected function get_legacy_eventdata() {
return $this->get_record_snapshot('groups', $this->objectid);
@ -90,5 +90,4 @@ class group_deleted extends base {
$this->data['edulevel'] = self::LEVEL_OTHER;
$this->data['objecttable'] = 'groups';
}
}

View File

@ -47,7 +47,7 @@ class group_updated extends base {
/**
* Legacy event data if get_legacy_eventname() is not empty.
*
* @return stdClass
* @return \stdClass
*/
protected function get_legacy_eventdata() {
return $this->get_record_snapshot('groups', $this->objectid);

View File

@ -47,7 +47,7 @@ class grouping_created extends base {
/**
* Legacy event data if get_legacy_eventname() is not empty.
*
* @return stdClass
* @return \stdClass
*/
protected function get_legacy_eventdata() {
return $this->get_record_snapshot('groupings', $this->objectid);
@ -90,5 +90,4 @@ class grouping_created extends base {
$this->data['edulevel'] = self::LEVEL_OTHER;
$this->data['objecttable'] = 'groupings';
}
}

View File

@ -54,7 +54,7 @@ class grouping_deleted extends base {
/**
* Legacy event data if get_legacy_eventname() is not empty.
*
* @return stdClass
* @return \stdClass
*/
protected function get_legacy_eventdata() {
return $this->get_record_snapshot('groupings', $this->objectid);
@ -97,5 +97,4 @@ class grouping_deleted extends base {
$this->data['edulevel'] = self::LEVEL_OTHER;
$this->data['objecttable'] = 'groupings';
}
}

View File

@ -90,5 +90,4 @@ class grouping_updated extends base {
$this->data['edulevel'] = self::LEVEL_OTHER;
$this->data['objecttable'] = 'groupings';
}
}

View File

@ -26,7 +26,7 @@ namespace core\event;
defined('MOODLE_INTERNAL') || die();
/**
* Event when user profile is deleted.
* User deleted event class.
*
* @property-read array $other {
* Extra information about event.
@ -117,23 +117,23 @@ class user_deleted extends base {
parent::validate_data();
if (!isset($this->other['username'])) {
throw new \coding_exception('username must be set in $other.');
throw new \coding_exception('The \'username\' value must be set in other.');
}
if (!isset($this->other['email'])) {
throw new \coding_exception('email must be set in $other.');
throw new \coding_exception('The \'email\' value must be set in other.');
}
if (!isset($this->other['idnumber'])) {
throw new \coding_exception('idnumber must be set in $other.');
throw new \coding_exception('The \'idnumber\' value must be set in other.');
}
if (!isset($this->other['picture'])) {
throw new \coding_exception('picture must be set in $other.');
throw new \coding_exception('The \'picture\' value must be set in other.');
}
if (!isset($this->other['mnethostid'])) {
throw new \coding_exception('mnethostid must be set in $other.');
throw new \coding_exception('The \'mnethostid\' value must be set in other.');
}
}
}

View File

@ -122,7 +122,7 @@ class user_enrolment_created extends base {
}
if (!isset($this->other['enrol'])) {
throw new \coding_exception('The \'enrol\' value must be set in $other.');
throw new \coding_exception('The \'enrol\' value must be set in other.');
}
}
}

View File

@ -115,13 +115,13 @@ class user_enrolment_deleted extends base {
protected function validate_data() {
parent::validate_data();
if (!isset($this->other['userenrolment'])) {
throw new \coding_exception('User enrolment must be set in $other.');
throw new \coding_exception('The \'userenrolment\' value must be set in other.');
}
if (!isset($this->other['enrol'])) {
throw new \coding_exception('Enrolment plugin name must be set in $other.');
throw new \coding_exception('The \'enrol\' value must be set in other.');
}
if (!isset($this->relateduserid)) {
throw new \coding_exception('Related user id must be set.');
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
}

View File

@ -108,10 +108,10 @@ class user_enrolment_updated extends base {
protected function validate_data() {
parent::validate_data();
if (!isset($this->other['enrol'])) {
throw new \coding_exception('Enrolment plugin name must be set in $other.');
throw new \coding_exception('The \'enrol\' value must be set in other.');
}
if (!isset($this->relateduserid)) {
throw new \coding_exception('Related user id must be set.');
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
}

View File

@ -123,11 +123,11 @@ class user_password_updated extends base {
parent::validate_data();
if (!$this->relateduserid) {
throw new \coding_exception('relateduserid needs to be set.');
throw new \coding_exception('The \'relateduserid\' must be set.');
}
if (!isset($this->other['forgottenreset'])) {
throw new \coding_exception('forgottenreset needs to be set in $other.');
throw new \coding_exception('The \'forgottenreset\' value must be set in other.');
}
}
}

View File

@ -120,7 +120,7 @@ class webservice_login_failed extends base {
} else if (!isset($this->other['method'])) {
throw new \coding_exception('The \'method\' value must be set in other.');
} else if (isset($this->other['token'])) {
throw new \coding_exception('The token cannot be set in $other.');
throw new \coding_exception('The \'token\' value must not be set in other.');
}
}
}

View File

@ -89,12 +89,13 @@ class webservice_service_user_added extends base {
/**
* Custom validation.
*
* @throws \coding_exception
* @return void
*/
protected function validate_data() {
parent::validate_data();
if (!isset($this->relateduserid)) {
throw new \coding_exception('The relateduserid must be set.');
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}

View File

@ -89,12 +89,13 @@ class webservice_service_user_removed extends base {
/**
* Custom validation.
*
* @throws \coding_exception
* @return void
*/
protected function validate_data() {
parent::validate_data();
if (!isset($this->relateduserid)) {
throw new \coding_exception('The relateduserid must be set.');
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}

View File

@ -97,5 +97,4 @@ class message_sent extends \core\event\base {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
}

View File

@ -135,5 +135,4 @@ class assessable_uploaded extends \core\event\assessable_uploaded {
public function set_legacy_logdata($legacylogdata) {
$this->legacylogdata = $legacylogdata;
}
}

View File

@ -86,4 +86,3 @@ class report_viewed extends \core\event\base {
}
}
}

View File

@ -96,4 +96,3 @@ class user_report_viewed extends \core\event\base {
}
}
}

View File

@ -119,9 +119,8 @@ class report_viewed extends \core\event\base {
throw new \coding_exception('The \'logformat\' value must be set in other.');
}
if (!isset($this->data['relateduserid'])) {
if (!isset($this->relateduserid)) {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
}

View File

@ -101,9 +101,8 @@ class user_report_viewed extends \core\event\base {
throw new \coding_exception('The \'mode\' value must be set in other.');
}
if (empty($this->data['relateduserid'])) {
if (empty($this->relateduserid)) {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
}

View File

@ -81,4 +81,3 @@ class report_viewed extends \core\event\base {
return new \moodle_url('/report/loglive/index.php', array('id' => $this->courseid));
}
}

View File

@ -101,7 +101,7 @@ class report_viewed extends \core\event\base {
if (empty($this->other['mode'])) {
throw new \coding_exception('The \'mode\' value must be set in other.');
}
if (empty($this->data['relateduserid'])) {
if (empty($this->relateduserid)) {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}

View File

@ -110,7 +110,7 @@ class report_viewed extends \core\event\base {
throw new \coding_exception('The \'mode\' value must be set in other.');
}
if (!isset($this->data['relateduserid'])) {
if (!isset($this->relateduserid)) {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}

View File

@ -90,7 +90,7 @@ class user_report_viewed extends \core\event\base {
*/
protected function validate_data() {
parent::validate_data();
if (empty($this->data['relateduserid'])) {
if (empty($this->relateduserid)) {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}