private function convertObjectToArray($data)
    {
        $converted = [];
        foreach($data as $key => $value) {
            if(is_object($value)) {
                $converted[$key] = $this->convertObjectToArray($value);
            } else {
                $converted[$key] = $value;
            }
        }

        return $converted;
    }
private function convertObjectToArray($data)
    {
        $converted = [];
        foreach($data as $key => $value) {
            if(is_object($value)) {
                $converted[$key] = $this->convertObjectToArray($value);
            } else {
                $converted[$key] = $value;
            }
        }

        return $converted;
    }
private function convertObjectToArray ( $ data ) { $ converted = [ ] ; foreach ( $ data as $ key => $ value ) { if ( is_object ( $ value ) ) { $ converted [ $ key ] = $ this -> convertObjectToArray ( $ value ) ; } else { $ converted [ $ key ] = $ value ; } } return $ converted ; }
Recursively convert the provided object to an array

@param mixed $data

@return array
Recursively convert the provided object to an array