public function serializeToJson(JsonSerializationVisitor $visitor, Iterable $iterable, array $type, Context $context) { return $visitor->visitArray(array('items' => $iterable->getItems(), 'total' => (int) $iterable->getTotalItems(), 'items_per_page' => $iterable->getItemsPerPage(), 'current_page' => $iterable->getCurrentPage()), $type, $context); }
public function __construct(Request $request, FormInterface $form, array $items, $totalItems, $currentPage = 0, $itemsPerPage = 10) { parent::__construct($items, $totalItems, $currentPage, $itemsPerPage); $this->request = $request; $this->form = $form; }