src/Sulu/Bundle/ContactBundle/Contact/ContactManager.php
protected function getApiObject($contact, $locale)
    {
        $apiObject = new ContactApi($contact, $locale);
        if ($contact->getAvatar()) {
            $apiAvatar = $this->mediaManager->getById($contact->getAvatar()->getId(), $locale);
            $apiObject->setAvatar($apiAvatar);
        }

        return $apiObject;
    }
protected function getApiObject($contact, $locale)
    {
        $apiObject = new ContactApi($contact, $locale);
        if ($contact->getAvatar()) {
            $apiAvatar = $this->mediaManager->getById($contact->getAvatar()->getId(), $locale);
            $apiObject->setAvatar($apiAvatar);
        }

        return $apiObject;
    }
protected function getApiObject ( $ contact , $ locale ) { $ apiObject = new ContactApi ( $ contact , $ locale ) ; if ( $ contact -> getAvatar ( ) ) { $ apiAvatar = $ this -> mediaManager -> getById ( $ contact -> getAvatar ( ) -> getId ( ) , $ locale ) ; $ apiObject -> setAvatar ( $ apiAvatar ) ; } return $ apiObject ; }
Takes a contact entity and a locale and returns the api object.

@param Contact $contact
@param string $locale

@return ContactApi
Takes a contact entity and a locale and returns the api object .