Example #1
0
 /**
  * Gets a list of all phone numbers available for the given Address object
  *
  * @param Address $object
  *
  * @return array of [phone number, phone owner]
  */
 public function getPhoneNumbers($object)
 {
     $result = [];
     $phone = $object->getPhone();
     if (!empty($phone)) {
         $result[] = [$phone, $object];
     }
     if ($object->getContactPhone() && $object->getContactPhone()->getPhone() !== $phone) {
         $result[] = [$object->getContactPhone()->getPhone(), $object->getContactPhone()->getOwner()];
     }
     return $result;
 }