Exemple #1
0
 /**
  * @param $region
  * @param $country
  * @param $originId
  *
  * @return CartAddress
  */
 protected function createCartAddress($region, $country, $originId)
 {
     $cartAddress = new CartAddress();
     $cartAddress->setRegion($region);
     $cartAddress->setCountry($country);
     $cartAddress->setCity('City');
     $cartAddress->setStreet('street');
     $cartAddress->setPostalCode(123456);
     $cartAddress->setFirstName('John');
     $cartAddress->setLastName('Doe');
     $cartAddress->setOriginId($originId);
     $cartAddress->setOrganization($this->organization);
     $this->em->persist($cartAddress);
     return $cartAddress;
 }
Exemple #2
0
 /**
  * @param string $countryCode
  * @return CartAddress
  */
 protected function getAddress($countryCode = null)
 {
     $address = new CartAddress();
     if ($countryCode) {
         $address->setCountry(new Country($countryCode));
     }
     return $address;
 }