getPersonaCustomers example

        $requirements = new AndRule(
            []
        );

        // first check if we either restrict our persona         // with direct customer assignments or with persona rules         if ($this->isCustomerRestriction()) {
            // we use assigned customers             // check if we have customers.             // if so, create customer rules for it and add that also as             // a separate OR condition to our main persona rule             if ($this->getPersonaCustomers() !== null) {
                $personaCustomerOR = new OrRule();

                foreach ($this->getPersonaCustomers()->getElements() as $customer) {
                    // build our new rule for this                     // customer and his/her customer number                     $custRule = new CustomerNumberRule();
                    $custRule->assign(['numbers' => [$customer->getCustomerNumber()], 'operator' => CustomerNumberRule::OPERATOR_EQ]);

                    $personaCustomerOR->addRule($custRule);
                }

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