use of com.liferay.portal.model.EmailAddress in project liferay-ide by liferay.
the class LiferayPersonService method getEmails.
protected List<ListField> getEmails(User user) throws Exception {
List<ListField> emails = new ArrayList<ListField>();
ListField email = new ListFieldImpl(Field.PRIMARY.toString(), user.getEmailAddress());
emails.add(email);
List<EmailAddress> emailAddresses = EmailAddressLocalServiceUtil.getEmailAddresses(user.getCompanyId(), User.class.getName(), user.getUserId());
for (EmailAddress emailAddress : emailAddresses) {
email = new ListFieldImpl(emailAddress.getType().getName(), emailAddress.getAddress());
emails.add(email);
}
return emails;
}
Aggregations