setPage($data['page']); } elseif (\array_key_exists('page', $data) && $data['page'] === null) { $object->setPage(null); } if (\array_key_exists('per_page', $data) && $data['per_page'] !== null) { $object->setPerPage($data['per_page']); } elseif (\array_key_exists('per_page', $data) && $data['per_page'] === null) { $object->setPerPage(null); } if (\array_key_exists('last_page', $data) && $data['last_page'] !== null) { $object->setLastPage($data['last_page']); } elseif (\array_key_exists('last_page', $data) && $data['last_page'] === null) { $object->setLastPage(null); } if (\array_key_exists('total_entries', $data) && $data['total_entries'] !== null) { $object->setTotalEntries($data['total_entries']); } elseif (\array_key_exists('total_entries', $data) && $data['total_entries'] === null) { $object->setTotalEntries(null); } return $object; } /** * @return array|string|int|float|bool|\ArrayObject|null */ public function normalize($object, $format = null, array $context = array()) { $data = array(); if (null !== $object->getPage()) { $data['page'] = $object->getPage(); } if (null !== $object->getPerPage()) { $data['per_page'] = $object->getPerPage(); } if (null !== $object->getLastPage()) { $data['last_page'] = $object->getLastPage(); } if (null !== $object->getTotalEntries()) { $data['total_entries'] = $object->getTotalEntries(); } return $data; } }