protected function objectToArray(stdClass $data = null)
    {
        if (null !== $data) {
            $data = (array) $data;
            foreach ($data as $key => $value) {
                if ($value instanceof stdClass) {
                    $data[$key] = $this->objectToArray($value);
                }
            }
        }

        return $data;
    }
protected function objectToArray(stdClass $data = null)
    {
        if (null !== $data) {
            $data = (array) $data;
            foreach ($data as $key => $value) {
                if ($value instanceof stdClass) {
                    $data[$key] = $this->objectToArray($value);
                }
            }
        }

        return $data;
    }
protected function objectToArray ( stdClass $ data = null ) { if ( null !== $ data ) { $ data = ( array ) $ data ; foreach ( $ data as $ key => $ value ) { if ( $ value instanceof stdClass ) { $ data [ $ key ] = $ this -> objectToArray ( $ value ) ; } } } return $ data ; }
Recursively convert the supplied object to an associative array.

@param stdClass|null $data The object to convert.

@return array<string,mixed> The converted associative array.
Recursively convert the supplied object to an associative array .