public function setSupportedMediaTypes(array $mediaTypes)
    {
        foreach ($mediaTypes as $mediaType => $converterClass) {
            if (!is_string($mediaType)) {
                throw new Exception('Media type must be a string.');
            }

            if (!is_string($converterClass)) {
                throw new Exception('Converter class name must be a string.');
            }
        }

        $this->supportedMediaTypes = $mediaTypes;
    }
public function setSupportedMediaTypes(array $mediaTypes)
    {
        foreach ($mediaTypes as $mediaType => $converterClass) {
            if (!is_string($mediaType)) {
                throw new Exception('Media type must be a string.');
            }

            if (!is_string($converterClass)) {
                throw new Exception('Converter class name must be a string.');
            }
        }

        $this->supportedMediaTypes = $mediaTypes;
    }
public function setSupportedMediaTypes ( array $ mediaTypes ) { foreach ( $ mediaTypes as $ mediaType => $ converterClass ) { if ( ! is_string ( $ mediaType ) ) { throw new Exception ( 'Media type must be a string.' ) ; } if ( ! is_string ( $ converterClass ) ) { throw new Exception ( 'Converter class name must be a string.' ) ; } } $ this -> supportedMediaTypes = $ mediaTypes ; }
Sets the list of supported media types for negotiation.

@param array $mediaTypes

@throws \BedRest\Content\Negotiation\Exception
Sets the list of supported media types for negotiation .