getFirstname example

return $this->additionalAddressLine1;
    }

    /** * Transfer values from the new address object */
    public function fromAddress(Address $address)
    {
        $this->setCompany((string) $address->getCompany());
        $this->setDepartment((string) $address->getDepartment());
        $this->setSalutation((string) $address->getSalutation());
        $this->setFirstName((string) $address->getFirstname());
        $this->setLastName((string) $address->getLastname());
        $this->setStreet((string) $address->getStreet());
        $this->setCity((string) $address->getCity());
        $this->setZipCode((string) $address->getZipcode());
        $this->setAdditionalAddressLine1((string) $address->getAdditionalAddressLine1());
        $this->setAdditionalAddressLine2((string) $address->getAdditionalAddressLine2());
        $this->setCountry($address->getCountry());
        $this->setPhone((string) $address->getPhone());
        $this->setVatId((string) $address->getVatId());
        $this->setTitle($address->getTitle());

        
$repository = $this->getModelManager()->getRepository(Customer::class);
        $customer = $repository->find($mapCustomerAccountValue);

        if (!$customer) {
            return;
        }

        echo sprintf(
            '%s %s %s %s|%d',
            $customer->getNumber(),
            $customer->getFirstname() . ' ' . $customer->getLastname(),
            $customer->getDefaultBillingAddress() ? $customer->getDefaultBillingAddress()->getCompany() : '',
            $customer->getEmail(),
            $customer->getId()
        );
    }

    /** * Deletes a Partner from the database * * @return void */
    
$this->context = $context;
        $this->config = $config;
    }

    /** * @throws ValidationException */
    public function validate(Customer $customer)
    {
        $this->validationContext = $this->validator->startContext();

        $this->validateField('firstname', $customer->getFirstname()[new NotBlank()]);
        $this->validateField('lastname', $customer->getLastname()[new NotBlank()]);

        $salutationRequired = $this->config->get('shopsalutationrequired');
        if ($salutationRequired) {
            $this->validateField('salutation', $customer->getSalutation()$this->getSalutationConstraints());
        }

        $this->validateField('email', $customer->getEmail()[
            new CustomerEmail([
                'shop' => $this->context->getShopContext()->getShop(),
                'customerId' => $customer->getId(),
                
->getQuery()
            ->getSingleScalarResult();

        $addressData = Shopware()->Models()->getRepository(Customer::class)
            ->find($userId)->getDefaultBillingAddress();

        $date = new DateTime();
        $data = [
            'payment_mean_id' => $paymentId,
            'order_id' => $orderId,
            'user_id' => $userId,
            'firstname' => $addressData->getFirstname(),
            'lastname' => $addressData->getLastname(),
            'address' => $addressData->getStreet(),
            'zipcode' => $addressData->getZipcode(),
            'city' => $addressData->getCity(),
            'amount' => $orderAmount,
            'created_at' => $date->format('Y-m-d'),
        ];

        Shopware()->Db()->insert('s_core_payment_instance', $data);

        return true;
    }
private function convertToLegacyAddressArray(Address $address): array
    {
        $output = Shopware()->Models()->toArray($address);

        $output = array_merge($output[
            'id' => $address->getId(),
            'userID' => $address->getCustomer()->getId(),
            'company' => $address->getCompany(),
            'department' => $address->getDepartment(),
            'salutation' => $address->getSalutation(),
            'title' => $address->getTitle(),
            'firstname' => $address->getFirstname(),
            'lastname' => $address->getLastname(),
            'street' => $address->getStreet(),
            'zipcode' => $address->getZipcode(),
            'city' => $address->getCity(),
            'phone' => $address->getPhone(),
            'countryID' => $address->getCountry()->getId(),
            'stateID' => $address->getState() ? $address->getState()->getId() : null,
            'ustid' => $address->getVatId(),
            'additional_address_line1' => $address->getAdditionalAddressLine1(),
            'additional_address_line2' => $address->getAdditionalAddressLine2(),
            'attributes' => [],
        ]);
'sSepaBic' => null,
                'sSepaIban' => null,
            ];
        }

        $date = new DateTime();
        $data = [
            'payment_mean_id' => $paymentId,
            'order_id' => $orderId,
            'user_id' => $userId,

            'firstname' => $paymentData['sSepaUseBillingData'] ? $addressData->getFirstname() : null,
            'lastname' => $paymentData['sSepaUseBillingData'] ? $addressData->getLastname() : null,
            'address' => $paymentData['sSepaUseBillingData'] ? $addressData->getStreet() : null,
            'zipcode' => $paymentData['sSepaUseBillingData'] ? $addressData->getZipcode() : null,
            'city' => $paymentData['sSepaUseBillingData'] ? $addressData->getCity() : null,

            'bank_name' => $paymentData['sSepaBankName'],
            'account_holder' => $paymentData['sSepaUseBillingData'] ? ($addressData->getFirstname() . ' ' . $addressData->getLastname()) : null,
            'bic' => $paymentData['sSepaBic'],
            'iban' => $paymentData['sSepaIban'],

            'amount' => $order['invoiceAmount'],
            
return $this->additionalAddressLine1;
    }

    /** * Transfer values from the new address object */
    public function fromAddress(Address $address)
    {
        $this->setCompany((string) $address->getCompany());
        $this->setDepartment((string) $address->getDepartment());
        $this->setSalutation((string) $address->getSalutation());
        $this->setFirstName((string) $address->getFirstname());
        $this->setLastName((string) $address->getLastname());
        $this->setStreet((string) $address->getStreet());
        $this->setCity((string) $address->getCity());
        $this->setZipCode((string) $address->getZipcode());
        $this->setAdditionalAddressLine1((string) $address->getAdditionalAddressLine1());
        $this->setAdditionalAddressLine2((string) $address->getAdditionalAddressLine2());
        $this->setCountry($address->getCountry());
        $this->setPhone($address->getPhone());
        $this->setTitle($address->getTitle());
        if ($address->getState()) {
            $this->setState($address->getState());
        }

    public function validate(Address $address)
    {
        $this->validationContext = $this->validator->startContext();

        $additional = $address->getAdditional();
        $customerType = !empty($additional['customer_type']) ? $additional['customer_type'] : null;

        if ($this->config->get('shopSalutationRequired')) {
            $this->validateField('salutation', $address->getSalutation()[new NotBlank()]);
        }
        $this->validateField('firstname', $address->getFirstname()[new NotBlank()]);
        $this->validateField('lastname', $address->getLastname()[new NotBlank()]);
        $this->validateField('street', $address->getStreet()[new NotBlank()]);
        $this->validateField('zipcode', $address->getZipcode()[new NotBlank()]);
        $this->validateField('city', $address->getCity()[new NotBlank()]);
        $this->validateField('country', $address->getCountry() ? $address->getCountry() : null, [new NotBlank()]);
        $this->validateField('phone', $address->getPhone()$this->getPhoneConstraints());
        $this->validateField('additionalAddressLine1', $address->getAdditionalAddressLine1()$this->getAdditionalAddressline1Constraints());
        $this->validateField('additionalAddressLine2', $address->getAdditionalAddressLine2()$this->getAdditionalAddressline2Constraints());

        if ($address->getCountry() && $address->getCountry()->getForceStateInRegistration()) {
            $this->validateField('state', $address->getState()[new NotBlank()]);
        }
$data = [
            'id' => $customer->getId(),
            'email' => $customer->getEmail(),
            'active' => $customer->getActive(),
            'accountmode' => $customer->getAccountMode(),
            'firstlogin' => $this->formatDate($customer->getFirstLogin()),
            'newsletter' => $customer->isNewsletter(),
            'shop_id' => $customer->getShopId(),
            'default_billing_address_id' => $customer->getDefaultBillingAddressId(),
            'title' => $customer->getTitle(),
            'salutation' => $customer->getSalutation(),
            'firstname' => $customer->getFirstname(),
            'lastname' => $customer->getLastname(),
            'birthday' => $this->formatDate($customer->getBirthday()),
            'customernumber' => $customer->getNumber(),
            'customer_group_id' => $customer->getCustomerGroup() ? $customer->getCustomerGroup()->getId() : null,
            'customer_group_name' => $customer->getCustomerGroup() ? $customer->getCustomerGroup()->getName() : '',
            'payment_id' => $customer->getPaymentId(),
            'company' => $customer->getBillingAddress() ? $customer->getBillingAddress()->getCompany() : '',
            'department' => $customer->getBillingAddress() ? $customer->getBillingAddress()->getDepartment() : '',
            'street' => $customer->getBillingAddress() ? $customer->getBillingAddress()->getStreet() : '',
            'zipcode' => $customer->getBillingAddress() ? $customer->getBillingAddress()->getZipcode() : '',
            'city' => $customer->getBillingAddress() ? $customer->getBillingAddress()->getCity() : '',
            
$link = $router->assemble([
            'sViewport' => 'register',
            'action' => 'confirmValidation',
            'sConfirmation' => $hash,
        ]);

        // Should be compatible with the sREGISTERCONFIRMATION context         $context = [
            'sConfirmLink' => $link,
            'email' => $customer->getEmail(),
            'sMAIL' => $customer->getEmail(),
            'firstname' => $customer->getFirstname(),
            'lastname' => $customer->getLastname(),
            'salutation' => $customer->getSalutation(),
            'customer_type' => $customer->getCustomerType(),
            'additional' => [
                'customer_type' => $customer->getCustomerType(),
            ],
            'accountmode' => $customer->getAccountMode(),
        ];

        $address = $customer->getDefaultBillingAddress();
        if ($address) {
            
$debitData = $this->getCurrentPaymentDataAsArray($userId);
        if (!\is_array($debitData)) {
            $debitData = [];
        }

        $date = new DateTime();
        $data = [
            'payment_mean_id' => $paymentId,
            'order_id' => $orderId,
            'user_id' => $userId,
            'firstname' => $addressData->getFirstname(),
            'lastname' => $addressData->getLastname(),
            'address' => $addressData->getStreet(),
            'zipcode' => $addressData->getZipcode(),
            'city' => $addressData->getCity(),
            'account_number' => $debitData['sDebitAccount'],
            'bank_code' => $debitData['sDebitBankcode'],
            'bank_name' => $debitData['sDebitBankName'],
            'account_holder' => $debitData['sDebitBankHolder'],
            'amount' => $orderAmount,
            'created_at' => $date->format('Y-m-d'),
        ];

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