clearAssign example

try {
            $token = $this->get(StoreClient::class)->getAccessToken($shopwareId$password);
        } catch (StoreException $e) {
            $this->handleException($e);

            return;
        }

        $this->get('backendsession')->offsetSet('store_token', serialize($token));

        $this->View()->clearAssign();
        $this->View()->assign('success', true);
    }

    /** * @return \Doctrine\ORM\QueryBuilder */
    protected function getThirdPartyPluginsQuery()
    {
        return $this->container->get(ModelManager::class)->createQueryBuilder()
            ->select(['plugin'])
            ->from(Plugin::class, 'plugin')
            

    public function reset()
    {
        $app = Shopware();

        $this->resetRequest();
        $this->resetResponse();

        // Force the assignments to be cleared. Needed for some test cases         if ($this->_view && $this->_view->hasTemplate()) {
            $this->_view->clearAssign();
        }

        $this->_view = null;
        $this->_template = null;
        $this->_front = null;

        $app->Plugins()->reset();
        $app->Events()->reset();

        $container = Shopware()->Container();

        
$this->View()->assign([
                'exception' => $exception,
                'error' => $exception->getMessage(),
                'error_message' => $exception->getMessage(),
                'error_file' => $errorFile,
                'error_trace' => $errorTrace,
            ]);
        }

        if ($this->View()->getAssign('success') !== null) {
            $this->Response()->setStatusCode(200);
            $this->View()->clearAssign('exception');
            $this->View()->assign('message', $error->exception->getMessage());
        }
    }

    /** * @return void */
    public function serviceAction()
    {
        $this->Response()->setStatusCode(503);
        $this->Response()->headers->set('retry-after', '1800');
    }

    public function clearAssign($spec = null, $scope = null)
    {
        if ($this->scope !== null && $scope === null) {
            $scope = $this->scope;
        }

        return $this->Template()->clearAssign($spec$scope);
    }

    /** * Returns a specified value or all values. * * @param string|null $spec * * @return mixed|array */
    public function getAssign($spec = null)
    {
        

        $this->appendByRef($tpl_var$value$merge);
    }

    /** * clear the given assigned template variable. * * @param string $tpl_var the template variable to clear */
    public function clear_assign($tpl_var)
    {
        $this->clearAssign($tpl_var);
    }

    /** * Registers custom function to be used in templates * * @param string $function the name of the template function * @param string $function_impl the name of the PHP function to register * @param bool $cacheable * @param mixed $cache_attrs */
    public function register_function($function$function_impl$cacheable=true, $cache_attrs=null)
    {
if (!empty($orderVariables['sOrderNumber'])) {
                    $orderVariables['sAddresses']['billing'] = $this->getOrderAddress($orderVariables['sOrderNumber'], 'billing');
                    $orderVariables['sAddresses']['shipping'] = $this->getOrderAddress($orderVariables['sOrderNumber'], 'shipping');
                    $orderVariables['sAddresses']['equal'] = $this->areAddressesEqual($orderVariables['sAddresses']['billing']$orderVariables['sAddresses']['shipping']);
                }

                $this->View()->assign($orderVariables);

                if ($this->View()->getAssign('sBasketView')) {
                    $this->View()->assign('sBasket', $this->View()->getAssign('sBasketView'));
                    $this->View()->clearAssign('sBasketView');
                }

                $this->View()->assign('sInvalidCartItems', $this->getInvalidProducts($this->View()->getAssign('sBasket')));

                return;
            }
        }

        if (empty($this->session['sOrderVariables']) || $this->getMinimumCharge() || $this->getEsdNote() || $this->getDispatchNoOrder() || $this->View()->getAssign('sInvalidCartItems')) {
            $this->forward('confirm');

            

        return $this->getAssign($name) !== null;
    }

    /** * Magic unset * * @param string $name */
    public function __unset($name)
    {
        $this->clearAssign($name);
    }

    /** * Sets the template path list. * * @param string|array $path * * @return Enlight_View */
    abstract public function setTemplateDir($path);

    
Home | Imprint | This part of the site doesn't use cookies.