public static function createFromArray($key, array $data = [])
    {
        $webFormBody = new static($key);

        if (isset($data['formParameters'])) {
            foreach ($data['formParameters'] as $namedParam => $namedParamData) {
                if (\is_array($namedParamData)) {
                    $webFormBody->addParameter(NamedParameter::createFromArray($namedParam, $namedParamData));
                }
            }
        }

        return $webFormBody;
    }
public static function createFromArray($key, array $data = [])
    {
        $webFormBody = new static($key);

        if (isset($data['formParameters'])) {
            foreach ($data['formParameters'] as $namedParam => $namedParamData) {
                if (\is_array($namedParamData)) {
                    $webFormBody->addParameter(NamedParameter::createFromArray($namedParam, $namedParamData));
                }
            }
        }

        return $webFormBody;
    }
public static function createFromArray ( $ key , array $ data = [ ] ) { $ webFormBody = new static ( $ key ) ; if ( isset ( $ data [ 'formParameters' ] ) ) { foreach ( $ data [ 'formParameters' ] as $ namedParam => $ namedParamData ) { if ( \ is_array ( $ namedParamData ) ) { $ webFormBody -> addParameter ( NamedParameter :: createFromArray ( $ namedParam , $ namedParamData ) ) ; } } } return $ webFormBody ; }
Create a new WebFormObject from an array

@param string $key The valid media type to use as the key
@param array $data The array of data to create NamedParameter objects from
@return WebFormBody
Create a new WebFormObject from an array