getQueryParameter example

if ($this->search !== null) {
            $options['search'] = $this->search;
        }

        if ($this->orderBy !== null) {
            $options['orderBy'] = $this->orderBy;
            $options['orderSequence'] = $this->orderSequence;
        }

        foreach ($this->getFilter() as $filter) {
            $options = [...$options, ...$filter->getQueryParameter()];
        }

        return $options;
    }

    public function setLimit(int $limit): void
    {
        $this->limit = $limit;
    }

    public function getLimit(): int
    {
public function testGetQueryOptionsWithMandatory(): void
    {
        $criteria = ExtensionCriteria::fromArray([
            'limit' => 25,
            'page' => 2,
        ]);

        static::assertEquals([
            'limit' => 25,
            'offset' => 25,
        ]$criteria->getQueryParameter());
    }

    public function testGetQueryOptionsWithAllOptions(): void
    {
        $criteria = ExtensionCriteria::fromArray([
            'limit' => 25,
            'page' => 2,
            'sort' => [
                [
                    'field' => 'rating',
                    'order' => 'DESC',
                ],
return $this->registrationRequest !== null && $this->confirmationRequest !== null;
    }

    public function reset(): void
    {
        $this->registrationRequest = null;
        $this->confirmationRequest = null;
    }

    private function buildAppResponse(RequestInterface $request): string
    {
        $shopUrl = $this->getQueryParameter($request, 'shop-url');
        $appname = $this->getAppname($request);
        $shopId = $this->getQueryParameter($request, 'shop-id');

        $proof = \hash_hmac('sha256', $shopId . $shopUrl . $appname, self::TEST_SETUP_SECRET);

        return (string) \json_encode(['proof' => $proof, 'secret' => self::APP_SECRET, 'confirmation_url' => self::CONFIRMATION_URL], \JSON_THROW_ON_ERROR);
    }

    private function isRegistration(RequestInterface $request): bool
    {
        $path = $request->getUri()->getPath();
        
return $filter;
    }

    /** * @return array<string, string> */
    public function getQueryParameter(): array
    {
        $parameter = [];

        foreach ($this->getQueries() as $query) {
            $parameter = array_merge($parameter$query->getQueryParameter());
        }

        return $parameter;
    }

    /** * @return array<FilterStruct> */
    public function getQueries(): array
    {
        return $this->queries;
    }
 [
                    'type' => 'equals',
                    'field' => 'category',
                    'value' => '5',
                ],
            ],
        ]);

        static::assertEquals([
            'ratings' => '2',
            'category' => '5',
        ]$filter->getQueryParameter());
    }

    public function testSetterFromEquals(): void
    {
        $filter = new EqualsFilterStruct();
        $filter->setField('field');
        $filter->setValue('value');

        static::assertEquals('field', $filter->getField());
        static::assertEquals('value', $filter->getValue());
    }
}
Home | Imprint | This part of the site doesn't use cookies.