setCompanyAddress() публичный Метод

public setCompanyAddress ( boolean $companyAddress )
$companyAddress boolean
Пример #1
0
 /**
  * {@inheritDoc}
  */
 public function load(ObjectManager $manager)
 {
     if (!$this->isEnabled()) {
         return;
     }
     $email = '*****@*****.**';
     $fakerGenerator = $this->getFakerGenerator();
     $firstName = $fakerGenerator->firstName;
     $lastName = $fakerGenerator->lastName;
     $clientGroup = $this->getReference('client_group');
     $client = $this->container->get('client.factory')->create();
     $client->getContactDetails()->setFirstName($firstName);
     $client->getContactDetails()->setLastName($lastName);
     $client->getContactDetails()->setEmail($email);
     $client->getContactDetails()->setPhone($fakerGenerator->phoneNumber);
     $client->getClientDetails()->setDiscount(25);
     $client->getClientDetails()->setUsername($email);
     $client->getClientDetails()->setHashedPassword('demo');
     $client->getClientDetails()->setConditionsAccepted(true);
     $client->getClientDetails()->setNewsletterAccepted(true);
     $client->setClientGroup($clientGroup);
     $billingAddress = new ClientBillingAddress();
     $billingAddress->setFirstName($firstName);
     $billingAddress->setLastName($lastName);
     $billingAddress->setLine1($fakerGenerator->address);
     $billingAddress->setLine2('');
     $billingAddress->setPostalCode($fakerGenerator->postcode);
     $billingAddress->setCity($fakerGenerator->city);
     $billingAddress->setCountry($fakerGenerator->countryCode);
     $billingAddress->setVatId(666777888999);
     $billingAddress->setCompanyName($fakerGenerator->company);
     $billingAddress->setState('');
     $billingAddress->setCompanyAddress(false);
     $shippingAddress = new ClientShippingAddress();
     $shippingAddress->setFirstName($firstName);
     $shippingAddress->setLastName($lastName);
     $shippingAddress->setLine1($fakerGenerator->address);
     $shippingAddress->setLine2('');
     $shippingAddress->setPostalCode($fakerGenerator->postcode);
     $shippingAddress->setCity($fakerGenerator->city);
     $shippingAddress->setCountry($fakerGenerator->countryCode);
     $shippingAddress->setState('');
     $shippingAddress->setCopyBillingAddress(true);
     $client->setBillingAddress($billingAddress);
     $client->setShippingAddress($shippingAddress);
     $client->setShop($this->getReference('shop'));
     $manager->persist($client);
     $manager->flush();
 }
 public function create() : ClientBillingAddressInterface
 {
     $address = new ClientBillingAddress();
     $address->setFirstName('');
     $address->setLastName('');
     $address->setLine1('');
     $address->setLine2('');
     $address->setPostalCode('');
     $address->setState('');
     $address->setCity('');
     $address->setCountry($this->shopStorage->getCurrentShop()->getDefaultCountry());
     $address->setCompanyAddress(false);
     $address->setCompanyName('');
     $address->setVatId('');
     return $address;
 }