/**
  * Gets a list of all phone numbers available for the given OrderAddress object
  *
  * @param OrderAddress $object
  *
  * @return array of [phone number, phone owner]
  */
 public function getPhoneNumbers($object)
 {
     $result = [];
     $phone = $object->getPhone();
     if (!empty($phone)) {
         $result[] = [$phone, $object];
     }
     return $result;
 }
Example #2
0
 protected function getOrderAddress(ObjectManager $om)
 {
     $address = new OrderAddress();
     $address->setCity('City');
     $address->setStreet('First street');
     $address->setPostalCode(123456);
     $address->setFirstName('John');
     $address->setLastName('Doe');
     /** @var Country $country */
     $country = $om->getRepository('OroAddressBundle:Country')->findOneBy(array('iso2Code' => 'US'));
     $address->setCountry($country);
     /** @var Region $region */
     $region = $om->getRepository('OroAddressBundle:Region')->findOneBy(array('combinedCode' => 'US-AK'));
     $address->setRegion($region);
     $om->persist($address);
     return $address;
 }