MDL-71086 core: load only those properties defined within persistent.
This commit is contained in:
@@ -403,7 +403,8 @@ abstract class persistent {
|
||||
* @return static
|
||||
*/
|
||||
final public function from_record(stdClass $record) {
|
||||
$record = (array) $record;
|
||||
$properties = static::properties_definition();
|
||||
$record = array_intersect_key((array) $record, $properties);
|
||||
foreach ($record as $property => $value) {
|
||||
$this->raw_set($property, $value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user