getAffiliate example


        $customer->setLanguageSubShop($subShop);

        if ($customer->getGroup() === null) {
            $customerGroup = $this->modelManager->find(Group::class$subShop->getCustomerGroup()->getId());
            if (!$customerGroup instanceof Group) {
                throw new ModelNotFoundException(Group::class$subShop->getCustomerGroup()->getId());
            }
            $customer->setGroup($customerGroup);
        }

        if ($customer->getAffiliate()) {
            $customer->setAffiliate((int) $this->getPartnerId($customer));
        } else {
            $customer->setAffiliate(0);
        }

        if (!$customer->getNumber() && $this->config->get('shopwareManagedCustomerNumbers')) {
            $customer->setNumber((string) $this->numberIncrementer->increment('user'));
        }

        $this->validator->validate($customer);
        $this->modelManager->persist($customer);
        
Home | Imprint | This part of the site doesn't use cookies.