note 128731 added to migration82.deprecated
| From: | tabflo at gmx dot at | Date: | Thu, 13 Jul 2023 13:43:56 +0000 |
| Subject: | note 128731 added to migration82.deprecated | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-220690@lists.php.net to get a copy of this message | ||
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 :)
----
Server IP: 45.112.84.4
Probable Submitter: 45.91.159.168 (proxied: 82.218.41.185)
----
Manual Page -- https://php.net/manual/en/migration82.deprecated.php
Edit -- https://main.php.net/note/edit/128731
Del: integrated -- https://main.php.net/note/delete/128731/integrated
Del: useless -- https://main.php.net/note/delete/128731/useless
Del: bad code -- https://main.php.net/note/delete/128731/bad+code
Del: spam -- https://main.php.net/note/delete/128731/spam
Del: non-english -- https://main.php.net/note/delete/128731/non-english
Del: in docs -- https://main.php.net/note/delete/128731/in+docs
Del: other reasons-- https://main.php.net/note/delete/128731
Reject -- https://main.php.net/note/reject/128731
Search -- https://main.php.net/manage/user-notes.php