magic methods fixed
This commit is contained in:
@@ -72,16 +72,16 @@ class record
|
|||||||
*/
|
*/
|
||||||
public function __set(string $name, mixed $value = null): void
|
public function __set(string $name, mixed $value = null): void
|
||||||
{
|
{
|
||||||
if (isset($this->values[$name])) {
|
if (property_exists(static, $name)) {
|
||||||
// Initialized the parameter
|
// Exist the property
|
||||||
|
|
||||||
// Writing the value and exit
|
// Writing the value and exit
|
||||||
$this->values[$name] = $value;
|
$this->values[$name] = $value;
|
||||||
} else {
|
} else {
|
||||||
// Not initialized the parameter
|
// Not exist the property
|
||||||
|
|
||||||
// Exit (fail)
|
// Exit (fail)
|
||||||
throw new exception_domain("Not found the parameter: $name");
|
throw new exception_domain("Not found the property: $name");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user