a have a baseclass for all databasemodels and handle my dynamic property setter and getter this way:
public array $dynamicProperties = [];
public function __set(string $name, mixed $value) {
if(property_exists($this, $name))
$this->{$name} = $value;
else
$this->dynamicProperties[$name] = $value;
}
public function __get(string $name) {
if(property_exists($this, $name))
return $this->$name;
else
return $this->dynamicProperties[$name];
}
just put the content into a class and extend from it. enjoy :)