mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
issue improve Object adds method
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@10141 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
bfcb28ea34
commit
2bd25445f8
1 changed files with 10 additions and 6 deletions
|
|
@ -79,12 +79,16 @@ class Object {
|
|||
* @brief method to set multiple key/value pairs as an additional variables
|
||||
* @param[in] $object either object or array containg key/value pairs to be added
|
||||
**/
|
||||
function adds($object) {
|
||||
if(is_object($object)) {
|
||||
$vars = get_object_vars($object);
|
||||
foreach($vars as $key => $val) $this->add($key, $val);
|
||||
} elseif(is_array($object)) {
|
||||
foreach($object as $key => $val) $this->add($key, $val);
|
||||
function adds($object)
|
||||
{
|
||||
if(is_object($object))
|
||||
{
|
||||
$object = get_object_vars($object);
|
||||
}
|
||||
|
||||
if(is_array($object))
|
||||
{
|
||||
foreach($object as $key => $val) $this->variables[$key] = $val;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue