/** * Merge the content negotiation configuration for the given controller * service into the REST metadata * * @param string $controllerServiceName * @param DoctrineRestServiceEntity $metadata * @param array $config */ protected function mergeContentNegotiationConfig($controllerServiceName, DoctrineRestServiceEntity $metadata, array $config) { if (!isset($config['zf-content-negotiation'])) { return; } $config = $config['zf-content-negotiation']; if (isset($config['controllers'][$controllerServiceName])) { $metadata->exchangeArray(['selector' => $config['controllers'][$controllerServiceName]]); } if (isset($config['accept-whitelist'][$controllerServiceName])) { $metadata->exchangeArray(['accept_whitelist' => $config['accept-whitelist'][$controllerServiceName]]); } if (isset($config['content-type-whitelist'][$controllerServiceName])) { $metadata->exchangeArray(['content-type-whitelist' => $config['content-type-whitelist'][$controllerServiceName]]); } }
/** * Merge the content negotiation configuration for the given controller * service into the REST metadata * * @param string $controllerServiceName * @param DoctrineRestServiceEntity $metadata * @param array $config */ protected function mergeContentNegotiationConfig($controllerServiceName, DoctrineRestServiceEntity $metadata, array $config) { // @codeCoverageIgnoreStart if (!isset($config['zf-content-negotiation'])) { return; } // @codeCoverageIgnoreEnd $config = $config['zf-content-negotiation']; if (isset($config['controllers']) && isset($config['controllers'][$controllerServiceName])) { $metadata->exchangeArray(array('selector' => $config['controllers'][$controllerServiceName])); } if (isset($config['accept-whitelist']) && isset($config['accept-whitelist'][$controllerServiceName])) { $metadata->exchangeArray(array('accept_whitelist' => $config['accept-whitelist'][$controllerServiceName])); } if (isset($config['content-type-whitelist']) && isset($config['content-type-whitelist'][$controllerServiceName])) { $metadata->exchangeArray(array('content-type-whitelist' => $config['content-type-whitelist'][$controllerServiceName])); } }