ProductPriceEntity example

public static function advancedPricesWillBeCalculatedProvider(): \Generator
    {
        yield 'Prices will not be calculated when not loaded' => [
            (new PartialEntity())->assign(['prices' => null]),
            [],
        ];

        yield 'Only product price collection can be calculated' => [
            (new PartialEntity())->assign([
                'prices' => new EntityCollection([
                    (new ProductPriceEntity())->assign([
                        '_uniqueIdentifier' => Uuid::randomHex(),
                        'price' => new PriceCollection([
                            new Price(Defaults::CURRENCY, 1, 1, false),
                        ]),
                        'quantityStart' => 1,
                        'quantityEnd' => 2,
                    ]),
                ]),
            ]),
            [],
        ];

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