You are here

public function OffsetPageNormalizer::denormalize in JSON:API 8

File

src/Normalizer/OffsetPageNormalizer.php, line 33

Class

OffsetPageNormalizer
The normalizer used for JSON API pagination.

Namespace

Drupal\jsonapi\Normalizer

Code

public function denormalize($data, $class, $format = NULL, array $context = []) {
  $expanded = $this
    ->expand($data);
  return new OffsetPage($expanded[OffsetPage::OFFSET_KEY], $expanded[OffsetPage::SIZE_KEY]);
}