public static function JsonSubrequestDenormalizer::getMethodFromAction in Subrequests 3.x
Same name and namespace in other branches
- 8.2 src/Normalizer/JsonSubrequestDenormalizer.php \Drupal\subrequests\Normalizer\JsonSubrequestDenormalizer::getMethodFromAction()
- 8 src/Normalizer/JsonSubrequestDenormalizer.php \Drupal\subrequests\Normalizer\JsonSubrequestDenormalizer::getMethodFromAction()
Gets the HTTP method from the list of allowed actions.
Parameters
string $action: The action name.
Return value
string The HTTP method.
1 call to JsonSubrequestDenormalizer::getMethodFromAction()
- JsonSubrequestDenormalizer::denormalize in src/
Normalizer/ JsonSubrequestDenormalizer.php - Denormalizes data back into an object of the given class.
File
- src/
Normalizer/ JsonSubrequestDenormalizer.php, line 96
Class
- JsonSubrequestDenormalizer
- Creates a request object for each Subrequest.
Namespace
Drupal\subrequests\NormalizerCode
public static function getMethodFromAction($action) {
switch ($action) {
case 'create':
return Request::METHOD_POST;
case 'update':
return Request::METHOD_PATCH;
case 'replace':
return Request::METHOD_PUT;
case 'delete':
return Request::METHOD_DELETE;
case 'exists':
return Request::METHOD_HEAD;
case 'discover':
return Request::METHOD_OPTIONS;
default:
return Request::METHOD_GET;
}
}