Programming Language PHP

Namespace Oro\Bundle\SalesBundle\Entity

Class B2bCustomer

Method/Function getPhones

Total Examples 1

1 code examples of PHP Oro\Bundle\SalesBundle\Entity\B2bCustomer::getPhones extracted from open source projects

Was this example useful?
0
                                                    /**
     * Gets a list of all phone numbers available for the given B2bCustomer object
     *
     *
     * @return array of [phone number, phone owner]
     */
    public function getPhoneNumbers(B2bCustomer $object): array
    {
        $result = [];
        foreach ($object->getPhones() as $phone) {
            $result[] = [$phone->getPhone(), $object];
        }

        if (!$result) {
            $contact = $object->getContact();
            if ($contact) {
                $result = $this->rootProvider->getPhoneNumbers($contact);
            }
        }

        return $result;
    }
                                            
B2bCustomer's Other Methods