public function add(array $data, $preserveArray = false, $preserveKeyOnly = null) {
        foreach ($data as $key => $value) {
            if (is_array($value) && (!$preserveArray || ($preserveArray && $preserveKeyOnly && $key !== $preserveKeyOnly))) {
                $this->$key = (array_key_exists(0, $value)) ? $value : new Object($value, $preserveArray, $preserveKeyOnly);
                continue;
            }

            if (is_int($key)) {
                $this->integerKeys[$key] = $value;
                continue;
            }

            $attr = Util::hyphenToCamel(Util::_toCamel($key));
            $this->{$attr} = $value;
        }
        return $this;
    }
public function add(array $data, $preserveArray = false, $preserveKeyOnly = null) {
        foreach ($data as $key => $value) {
            if (is_array($value) && (!$preserveArray || ($preserveArray && $preserveKeyOnly && $key !== $preserveKeyOnly))) {
                $this->$key = (array_key_exists(0, $value)) ? $value : new Object($value, $preserveArray, $preserveKeyOnly);
                continue;
            }

            if (is_int($key)) {
                $this->integerKeys[$key] = $value;
                continue;
            }

            $attr = Util::hyphenToCamel(Util::_toCamel($key));
            $this->{$attr} = $value;
        }
        return $this;
    }
public function add ( array $ data , $ preserveArray = false , $ preserveKeyOnly = null ) { foreach ( $ data as $ key => $ value ) { if ( is_array ( $ value ) && ( ! $ preserveArray || ( $ preserveArray && $ preserveKeyOnly && $ key !== $ preserveKeyOnly ) ) ) { $ this -> $ key = ( array_key_exists ( 0 , $ value ) ) ? $ value : new Object ( $ value , $ preserveArray , $ preserveKeyOnly ) ; continue ; } if ( is_int ( $ key ) ) { $ this -> integerKeys [ $ key ] = $ value ; continue ; } $ attr = Util :: hyphenToCamel ( Util :: _toCamel ( $ key ) ) ; $ this -> { $ attr } = $ value ; } return $ this ; }
Adds data to the object
@param array $data
@param boolean $preserveArray Indicates whether to preserve array or turn them objects too
@return Object
@throws \Exception
Adds data to the object