setCashed example

public function updateVoucherCodesAction()
    {
        $codeId = (int) $this->Request()->getParam('id');
        $code = $this->get(ModelManager::class)->getRepository(Code::class)->find($codeId);

        if (!$code instanceof Code) {
            $this->View()->assign(['success' => false]);

            return;
        }

        $code->setCashed($this->Request()->getParam('cashed'));
        $code->setCode($this->Request()->getParam('code'));
        $code->setCustomerId($this->Request()->getParam('customerId'));

        $this->get(ModelManager::class)->persist($code);
        $this->get(ModelManager::class)->flush($code);

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

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