PHP Class eZ\Publish\Core\REST\Common\Input\ParsingDispatcher

Afficher le fichier Open project: ezsystems/ezpublish-kernel Class Usage Examples

Protected Properties

Свойство Type Description
$parsers Parser[] Structure: array( => array( => , … } )

Méthodes publiques

Méthode Description
__construct ( array $parsers = [] ) Construct from optional parsers array.
addParser ( string $mediaType, Parser $parser ) Adds another parser for the given Content Type.
parse ( array $data, string $mediaType ) : eZ\Publish\API\Repository\Values\ValueObject Parses the given $data according to $mediaType.

Méthodes protégées

Méthode Description
parseMediaTypeVersion ( string $mediaType ) : string Parses and returns the version from a MediaType.

Method Details

__construct() public méthode

Construct from optional parsers array.
public __construct ( array $parsers = [] )
$parsers array

addParser() public méthode

Adds another parser for the given Content Type.
public addParser ( string $mediaType, Parser $parser )
$mediaType string
$parser Parser

parse() public méthode

Parses the given $data according to $mediaType.
public parse ( array $data, string $mediaType ) : eZ\Publish\API\Repository\Values\ValueObject
$data array
$mediaType string
Résultat eZ\Publish\API\Repository\Values\ValueObject

parseMediaTypeVersion() protected méthode

Parses and returns the version from a MediaType.
protected parseMediaTypeVersion ( string $mediaType ) : string
$mediaType string Ex: text/html; version=1.1
Résultat string An array with the mediatype string, stripped from the version, and the version (1.0 by default)

Property Details

$parsers protected_oe property

Structure: array( => array( => , … } )
protected Parser[],eZ\Publish\Core\REST\Common\Input $parsers
Résultat Parser[]