AggregationParser example

$ids = array_filter($ids);
        if (empty($ids)) {
            throw DataAbstractionLayerException::invalidCriteriaIds($ids, 'Ids should not be empty');
        }
        $this->validateIds($ids);

        $this->ids = $ids;
    }

    public function __toString(): string
    {
        $parsed = (new CriteriaArrayConverter(new AggregationParser()))->convert($this);

        return Json::encode($parsed);
    }

    /** * @return array<string>|array<array<string, string>> */
    public function getIds(): array
    {
        return $this->ids;
    }

    

class RequestCriteriaBuilderTest extends TestCase
{
    private RequestCriteriaBuilder $requestCriteriaBuilder;

    private StaticDefinitionInstanceRegistry $staticDefinitionRegistry;

    protected function setUp(): void
    {
        $aggregationParser = new AggregationParser();

        $this->staticDefinitionRegistry = new StaticDefinitionInstanceRegistry(
            [
                new ProductDefinition(),
                new ProductOptionDefinition(),
                new PropertyGroupOptionDefinition(),
                new ProductPriceDefinition(),
                new ProductCategoryDefinition(),
                new CategoryDefinition(),
            ],
            $this->createMock(ValidatorInterface::class),
            
Home | Imprint | This part of the site doesn't use cookies.