note 114400 added to language.oop5.properties
| From: | AshleyDambra at live dot com | Date: | Sun, 16 Feb 2014 10:08:24 +0000 |
| Subject: | note 114400 added to language.oop5.properties | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-198525@lists.php.net to get a copy of this message | ||
Add this method to you class in order to 'transtypage' all the array properties into
stdClass();
Hope it help you.
public function objectThis($object = null) {
if (!$object) {
foreach ($this as $property_name => $property_values) {
if (is_array($property_values)) {
$this->{$property_name} = $this->objectThis($property_values);
}
}
} else {
$object2 = new stdClass();
foreach ($object as $index => $values) {
if (is_array($values)) {
$object2->{$index} = $this->objectThis($values);
} else {
$object2->{$index} = $values;
}
}
return $object2;
}
}
----
Server IP: 72.52.91.14
Probable Submitter: 72.52.91.14
----
Manual Page -- http://php.net/manual/en/language.oop5.properties.php
Edit -- https://master.php.net/note/edit/114400
Del: integrated -- https://master.php.net/note/delete/114400/integrated
Del: useless -- https://master.php.net/note/delete/114400/useless
Del: bad code -- https://master.php.net/note/delete/114400/bad+code
Del: spam -- https://master.php.net/note/delete/114400/spam
Del: non-english -- https://master.php.net/note/delete/114400/non-english
Del: in docs -- https://master.php.net/note/delete/114400/in+docs
Del: other reasons-- https://master.php.net/note/delete/114400
Reject -- https://master.php.net/note/reject/114400
Search -- https://master.php.net/manage/user-notes.php