Programming Language PHP
Namespace Oro\Bundle\AccountBundle\Entity
Class Account
Method/Function getContacts
Total Examples 1
1 code examples of PHP Oro\Bundle\AccountBundle\Entity\Account::getContacts extracted from open source projects
/**
* Gets a list of all phone numbers available for the given Account object
*
*
* @return array of [phone number, phone owner]
*/
public function getPhoneNumbers(Account $object): array
{
$defaultContact = $object->getDefaultContact();
$result = $defaultContact ? $this->rootProvider->getPhoneNumbers($defaultContact) : [];
foreach ($object->getContacts() as $contact) {
if ($contact !== $defaultContact) {
$result = array_merge($result, $this->rootProvider->getPhoneNumbers($contact));
}
}
return $result;
}