getParams example

private function setupDB(Connection $orgConnection): Connection
    {
        // Be sure that we are on the no migrations db         static::assertStringContainsString('_no_migrations', $this->databaseName, 'Wrong DB ' . $this->databaseName);

        $orgConnection->executeStatement('DROP DATABASE IF EXISTS `' . $this->databaseName . '`');

        $orgConnection->executeStatement('CREATE DATABASE `' . $this->databaseName . '` DEFAULT CHARACTER SET utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci');

        $connection = new Connection(
            array_merge(
                $orgConnection->getParams(),
                [
                    'url' => $_SERVER['DATABASE_URL'],
                    'dbname' => $this->databaseName,
                ]
            ),
            $orgConnection->getDriver(),
            $orgConnection->getConfiguration(),
        );

        /** @var string $dumpFile */
        $dumpFile = file_get_contents(__DIR__ . '/../../schema.sql');

        
$categoryId = (int) $request->getParam('sCategory');

        $categoryContent = Shopware()->Modules()->Categories()->sGetCategoryContent($categoryId);

        $config = $this->getEmotionConfiguration($categoryId, true, $categoryContent['streamId'] ?? null);

        $config = array_merge($config[
            'sBanner' => Shopware()->Modules()->Marketing()->sBanner($categoryId),
            'sCategoryContent' => $categoryContent,
            'Controller' => 'listing',
            'params' => $this->Request()->getParams(),
        ]);

        $this->View()->assign($config);
    }

    /** * @return void */
    public function listingAction(Request $request, ShopContextInterface $context)
    {
        $this->View()->loadTemplate('frontend/listing/customer_stream/listing.tpl');

        


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

    public function saveDataAction()
    {
        /** @var \Shopware\Bundle\AttributeBundle\Service\DataPersisterInterface $dataPersister */
        $dataPersister = $this->get(\Shopware\Bundle\AttributeBundle\Service\DataPersisterInterface::class);

        $data = [];
        foreach ($this->Request()->getParams() as $key => $value) {
            $key = str_replace(CrudServiceInterface::EXT_JS_PREFIX, '', $key);
            $data[$key] = $value;
        }

        try {
            $dataPersister->persist(
                $data,
                $this->Request()->getParam('_table'),
                $this->Request()->getParam('_foreignKey')
            );
        } catch (Exception $e) {
            

    public function saveAction()
    {
        if (!$this->_isAllowed('save', 'emotion')) {
            throw new Enlight_Controller_Exception('You do not have sufficient rights to save a preset.', 401);
        }

        $resource = $this->container->get(EmotionPreset::class);
        $transformer = $this->container->get(EmotionToPresetDataTransformerInterface::class);
        $data = $this->Request()->getParams();

        if (empty($data['emotionId'])) {
            $this->View()->assign(['success' => false]);

            return;
        }

        $data = array_merge($data$transformer->transform($data['emotionId']));

        if (!empty($data['id'])) {
            $resource->update($data['id']$data$this->getLocale());
        }
new Cookie(
                    $restoreData->getSessionName(),
                    $restoreData->getValue(),
                    0,
                    \ini_get('session.cookie_path'),
                    null,
                    $request->isSecure()
                )
            );
        }

        $params = $request->getParams();
        unset($params[PaymentTokenService::TYPE_PAYMENT_TOKEN]);

        $controller->redirect($params);
    }
}

        $this->namespace = Shopware()->Snippets()->getNamespace('backend/banner/banner');
    }

    /** * Basis Method to gather banner information. * * If the parameter is set true, every banner will be counted as shown */
    public function getAllBanners()
    {
        $params = $this->Request()->getParams();
        $filter = (empty($params['categoryId'])) ? '' : $params['categoryId'];

        $query = $this->repository->getBanners($filter);
        $banners = $query->getArrayResult();

        // Restructures the data to better fit extjs model         $nodes = $this->prepareBannerData($banners);
        $this->View()->assign(['success' => !empty($nodes), 'data' => $nodes]);
    }

    /** * Returns all known banner entries. Live shopping items will be ignored. * * This call will have NO impact on the generated statistic - this method * should be uses for backend operations only! */


        $children = $this->renderer->renderChildren($o);

        $header = '';

        if (null !== ($s = $o->getModifiers())) {
            $header .= '<var>'.$s.'</var> ';
        }

        if (null !== ($s = $o->getName())) {
            $header .= '<dfn>'.$this->renderer->escape($s).'('.$this->renderer->escape($o->getParams()).')</dfn> ';
        }

        $header .= '<var>Closure</var>';
        if (isset($o->spl_object_id)) {
            $header .= '#'.((int) $o->spl_object_id);
        }
        $header .= ' '.$this->renderer->escape(Kint::shortenPath($o->filename)).':'.(int) $o->startline;

        $header = $this->renderer->renderHeaderWrapper($o(bool) \strlen($children)$header);

        return '<dl>'.$header.$children.'</dl>';
    }
public function detailAction(int $id): void
    {
        $this->View()->assign(
            $this->getDetail($id)
        );
    }

    public function createAction(): void
    {
        $id = $this->repository->save(
            $this->Request()->getParams()
        );

        $this->View()->assign(
            $this->getDetail($id)
        );
    }

    public function updateAction(int $id): void
    {
        $this->repository->save(
            $this->Request()->getParams(),
            
$navigation['currentListing']['position'] = $index + 1;
            $navigation['currentListing']['totalCount'] = $searchResult->getTotalCount();

            return $navigation;
        }

        return [];
    }

    private function buildCategoryLink(int $categoryId, Enlight_Controller_Request_RequestHttp $request): string
    {
        $params = $this->queryAliasMapper->replaceLongParams($request->getParams());

        unset(
            $params['__csrf_token'],
            $params['ordernumber'],
            $params['categoryId'],
            $params['module'],
            $params['controller'],
            $params['action']
        );

        $params = array_merge(
            
if ($this->get(Shopware_Components_Config::class)->get('traceSearch', true)) {
            $this->get('shopware_searchdbal.search_term_logger')->logResult(
                $criteria,
                $result,
                $context->getShop()
            );
        }

        $pageCounts = $this->get(Shopware_Components_Config::class)->get('fuzzySearchSelectPerPage');

        $request = $this->Request()->getParams();
        $request['sSearchOrginal'] = $term;

        $mapper = $this->get(QueryAliasMapper::class);

        $service = Shopware()->Container()->get(CustomSortingServiceInterface::class);

        $sortingIds = $this->container->get(Shopware_Components_Config::class)->get('searchSortings');
        $sortingIds = array_filter(explode('|', $sortingIds));
        $sortingIds = array_map('\intval', $sortingIds);
        $sortings = $service->getList($sortingIds$context);

        
'data' => $data,
        ]);
    }

    /** * Called when a single entity (=> product) is stored * * @retrun void */
    public function saveSingleEntityAction()
    {
        $params = $this->Request()->getParams();
        $resource = $this->Request()->getParam('resource');

        // Sort out context params         foreach ($params as $key => &$value) {
            if (preg_match('/[0-9a-z]+_[0-9a-z]+/i', $key) !== 1) {
                unset($params[$key]);
                continue;
            }
            [$entity$field] = explode('_', $key);
            $value = ['entity' => $entity, 'field' => $field, 'value' => $value];
        }

        
$header = '<var>PHP internal call</var> ';
        }

        if ($o->trace['class']) {
            $header .= $this->renderer->escape($o->trace['class'].$o->trace['type']);
        }

        if (\is_string($o->trace['function'])) {
            $function = $this->renderer->escape($o->trace['function'].'()');
        } else {
            $function = $this->renderer->escape(
                $o->trace['function']->getName().'('.$o->trace['function']->getParams().')'
            );

            if (null !== ($url = $o->trace['function']->getPhpDocUrl())) {
                $function = '<a href="'.$url.'" target=_blank>'.$function.'</a>';
            }
        }

        $header .= '<dfn>'.$function.'</dfn>';

        $children = $this->renderer->renderChildren($o);
        $header = $this->renderer->renderHeaderWrapper($o(bool) \strlen($children)$header);

        

    public function match($pathInfo, ?Context $context = null)
    {
        if ($context === null) {
            $context = clone $this->context;
        }

        foreach ($this->matchers as $route) {
            $params = $route->match($pathInfo$context);
            if (\is_array($params)) {
                // Adds support for rewrite queries                 return array_merge($params$context->getParams());
            }
        }

        return false;
    }

    /** * {@inheritdoc} */
    public function generateList(array $list, ?Context $context = null)
    {
        
if (str_starts_with($pathInfo, '/backend/') || str_starts_with($pathInfo, '/api/')) {
            return $pathInfo;
        }

        $shopId = $context->getShopId();
        // Consider SEO URLs only if the shop ID is set, which is the case e.g. for storefront requests         if ($shopId === null) {
            return $pathInfo;
        }

        // Rewrites queries         $params = $context->getParams();
        $params = $this->queryAliasMapper->replaceShortParams($params);

        if (isset($params['sAction'])) {
            $params['action'] = $params['sAction'];
        }

        if (isset($params['sViewport'])) {
            $params['controller'] = $params['sViewport'];
        }

        $context->setParams($params);

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

    /** * Sends the mail to the merchant if the inquiry was * successful or was declined. * * @return void */
    public function sendMailToMerchantAction()
    {
        $params = $this->Request()->getParams();
        $mail = clone $this->get('mail');

        $toMail = $params['toMail'];
        $fromName = $params['fromName'];
        $fromMail = $params['fromMail'];
        $subject = $params['subject'];
        $content = $params['content'];
        $userId = $params['userId'];
        $status = $params['status'];

        if (!$toMail || !$fromName || !$fromMail || !$subject || !$content || !$userId) {
            
Home | Imprint | This part of the site doesn't use cookies.