Back to ApiApplication class

Method addFormatMap

public void
addFormatMap
(mixed $contentHeader, mixed $format)
Adds a mapping from a content type to the format stored. Note the format type cannot be overwritten.
Parameters
  • string $contentHeader The content header
  • string $format The content type format
Returns
  • void
Since
  • 4.0.0

Method addFormatMap - Source code

/**
 * Adds a mapping from a content type to the format stored. Note the format type cannot be overwritten.
 *
 * @param   string  $contentHeader  The content header
 * @param   string  $format         The content type format
 *
 * @return  void
 *
 * @since   4.0.0
 */
public function addFormatMap($contentHeader, $format)
{
    if (!\array_key_exists($contentHeader, $this->formatMapper)) {
        $this->formatMapper[$contentHeader] = $format;
    }
}