Determining if module member exists using beans

Hi all,
I’m doing a mass import of data from an iSeries to SuiteCRM. I’ll want to update existing items and create new ones. I’m dealing with accounts, contacts, and users. What’s the recommended way to find out if a member of one of these modules matches the information I’m about to work with?

I’ve read that getBean(type, $id) will fill $id with a value if the bean exists, and null otherwise, but I don’t see how that works if the module hasn’t been searched yet. I’ve also read sample code suggesting the use of retrieve_by_string_fields, checking if the return is null not not. Is that better than my first way? It certainly makes more sense. Thanks for any help!

For now, I’m using the method of testing if retrieve_by_string_fields returns null. A follow-up question, though: what happens if the account and contact members both exist, and I’ve updated some fields in one or both, then I go to add a relationship? If I call add(), and the contact has already been added to the account, what will happen? I’m hoping nothing bad, as I’m making a job to run once a day to sync the CRM with any changes in the iSeries. I don’t want to have to do all this manually, once I know it’s working. But I also don’t want to be adding multiple links between the same two members.