prepareDateAndTime example


        // Check if we are allowed to update a db entry         if (!$this->_isAllowed('update')) {
            $this->View()->assign([
                'success' => false,
                'errorMsg' => $this->namespace->get('no_update_rights', 'Update access denied.')]);
        }

        $params = $this->Request()->getParams();

        // Build a single from date instead of two parts         $params['validFrom'] = $this->prepareDateAndTime($this->Request()->get('validFromDate')$this->Request()->get('validFromTime'));
        // Build a single till date instead of two dates         $params['validTo'] = $this->prepareDateAndTime($this->Request()->get('validToDate')$this->Request()->get('validToTime'));
        // Get media manager         $mediaManagerData = $this->Request()->get('media-manager-selection');

        // Update database entries         if (!$createMode) {
            // Load model from db             $bannerModel = $this->repository->find($id);
            if (!$bannerModel instanceof Banner) {
                throw new ModelNotFoundException(Banner::class(int) $id);
            }
Home | Imprint | This part of the site doesn't use cookies.