EqualsFilterStruct example


        ]);

        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());
    }
}

    protected $field;

    /** * @var string */
    protected $value;

    public static function fromArray(array $data): FilterStruct
    {
        $filter = new EqualsFilterStruct();
        $filter->assign($data);

        return $filter;
    }

    /** * @return array<string, string> */
    public function getQueryParameter(): array
    {
        return [$this->field => $this->value];
    }
Home | Imprint | This part of the site doesn't use cookies.