/** * Retrieves the generated vcard for a record * * @param $api ServiceBase The API class of the request, used in cases where the API changes how the fields are pulled from the args array. * @param $args array The arguments array passed in from the API * * @return String */ protected function getVcardForRecord($api, $args) { $bean = $this->loadBean($api, $args); if (!$bean->ACLAccess('view')) { throw new SugarApiExceptionNotAuthorized('No access to view records for module: ' . $args['module']); } $vcard = new vCard(); if (isset($args['module'])) { $module = clean_string($args['module']); } else { $module = 'Contacts'; } $vcard->loadContact($args['record'], $module); return $vcard->saveVCardApi($api); }