mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-50561 messages: Add missing __isset magic method
This commit is contained in:
parent
f4bfbd5aa2
commit
2291883052
1 changed files with 14 additions and 0 deletions
|
@ -215,6 +215,20 @@ class message {
|
|||
throw new \coding_exception("Invalid property $prop specified");
|
||||
}
|
||||
|
||||
/**
|
||||
* Magic method to check if property is set.
|
||||
*
|
||||
* @param string $prop name of property to check.
|
||||
* @return bool
|
||||
* @throws \coding_exception
|
||||
*/
|
||||
public function __isset($prop) {
|
||||
if (in_array($prop, $this->properties)) {
|
||||
return isset($this->$prop);
|
||||
}
|
||||
throw new \coding_exception("Invalid property $prop specified");
|
||||
}
|
||||
|
||||
/**
|
||||
* This method lets you define content that would be added to the message only for specific message processors.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue