You are here

protected function ServiceResourceOptionsTrait::getFormatOptions in Services 8.4

Same name and namespace in other branches
  1. 9.0.x src/ServiceResourceOptionsTrait.php \Drupal\services\ServiceResourceOptionsTrait::getFormatOptions()

Get HTTP format options.

Return value

array An array of HTTP serializer format options.

2 calls to ServiceResourceOptionsTrait::getFormatOptions()
ServiceResourceConfigForm::form in src/Form/ServiceResourceConfigForm.php
Gets the actual form array to be built.
ServiceSettingsForm::buildForm in src/Form/ServiceSettingsForm.php
Form constructor.

File

src/ServiceResourceOptionsTrait.php, line 30

Class

ServiceResourceOptionsTrait
Trait \Drupal\services\ServiceResourceOptionsTrait.

Namespace

Drupal\services

Code

protected function getFormatOptions() {
  $formats = \Drupal::getContainer()
    ->getParameter('serializer.formats');
  return array_combine($formats, $formats);
}