getVoucherCodeListQuery example

public function getVoucherCodesAction()
    {
        $voucherId = (int) $this->Request()->getParam('voucherID');

        $orderBy = $this->Request()->getParam('sort');
        $filter = $this->Request()->getParam('filter');
        $filter = $filter[0]['value'] ?? null;
        $offset = $this->Request()->getParam('start');
        $limit = $this->Request()->getParam('limit');

        $dataQuery = $this->getVoucherRepository()
            ->getVoucherCodeListQuery($voucherId$filter$orderBy$offset$limit);

        $paginator = $this->getManager()->createPaginator($dataQuery);

        $totalCount = $paginator->count();
        $voucherCodes = iterator_to_array($paginator);

        $this->View()->assign(['success' => true, 'data' => $voucherCodes, 'totalCount' => $totalCount]);
    }

    /** * creates all necessary voucher codes * * @return void */
Home | Imprint | This part of the site doesn't use cookies.