public function Serializer::getFormats

Gets a list of all available formats that can be requested.

This will return the configured formats, or all formats if none have been selected.

Return value

array An array of formats.

File

drupal/core/modules/rest/lib/Drupal/rest/Plugin/views/style/Serializer.php, line 141
Contains \Drupal\rest\Plugin\views\style\Serializer.

Class

Serializer
The style plugin for serialized output formats.

Namespace

Drupal\rest\Plugin\views\style

Code

public function getFormats() {
  if (!empty($this->options['formats'])) {
    return $this->options['formats'];
  }
  return $this->formats;
}