setCustomerRestriction example


    public function testPreconditionRulePersonaRules(): void
    {
        $fakePersonaRule = new AndRule();

        $personaRuleEntity = new RuleEntity();
        $personaRuleEntity->setId('R1');
        $personaRuleEntity->setPayload($fakePersonaRule);

        $promotion = new PromotionEntity();
        $promotion->setCustomerRestriction(false);

        $promotion->setPersonaRules(new RuleCollection([$personaRuleEntity]));

        $expected = new AndRule(
            [
                new OrRule(
                    [$fakePersonaRule]
                ),
            ]
        );

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