src/Iadvize/ApiRestClient/Response/Data.php
public function setData($data)
    {
        $this->data = null;

        if (is_array($data)) {
            foreach ($data as $index => $fields) {
                if (is_array($fields)) {
                    foreach ($fields as $key => $value) {
                        if ('id' == $key && is_array($value)) {
                            foreach ($value as $subKey => $subValue) {
                                $this->data[$index][$subKey] = $subValue;
                            }
                        } else {
                            $this->data[$index][$key] = $value;
                        }
                    }
                } else {
                    $this->data[$index] = $fields;
                }
            }
        } else {
            $this->data = $data;
        }
    }
public function setData($data)
    {
        $this->data = null;

        if (is_array($data)) {
            foreach ($data as $index => $fields) {
                if (is_array($fields)) {
                    foreach ($fields as $key => $value) {
                        if ('id' == $key && is_array($value)) {
                            foreach ($value as $subKey => $subValue) {
                                $this->data[$index][$subKey] = $subValue;
                            }
                        } else {
                            $this->data[$index][$key] = $value;
                        }
                    }
                } else {
                    $this->data[$index] = $fields;
                }
            }
        } else {
            $this->data = $data;
        }
    }
public function setData ( $ data ) { $ this -> data = null ; if ( is_array ( $ data ) ) { foreach ( $ data as $ index => $ fields ) { if ( is_array ( $ fields ) ) { foreach ( $ fields as $ key => $ value ) { if ( 'id' == $ key && is_array ( $ value ) ) { foreach ( $ value as $ subKey => $ subValue ) { $ this -> data [ $ index ] [ $ subKey ] = $ subValue ; } } else { $ this -> data [ $ index ] [ $ key ] = $ value ; } } } else { $ this -> data [ $ index ] = $ fields ; } } } else { $ this -> data = $ data ; } }
Set data
(fix JSON Decode)

@param mixed $data
Set data ( fix JSON Decode )