Trying to code section of site to update a conact and add to a 2nd list but found this function on another posts but it always returns true
if conact is already on another list and does not add to 2nd list.
public function addOrUpdate($contactInfo) {
Without knowing specifically what functionality is wanted by each individual using a function to add or update, it's hard to make one that would work for everyone. The function you pasted above was meant to complete replace the entire contacts information with the details that were submitted to that function. The one below does it's best to determine what details were actually submitted to this function and need to be updated by seeing if each field actual has a value other than null/empty.
In regards to the function turning back 'true' every time, this is because the addSubscriber() and editSubscriber() functions that this function uses are always turning those values back. This is something that we will look at resolving, but I do want to let you know that we are mainly planning on maintaining our PHP Library going forward, as opposed to these older samples.
Please let me know if you have any questions or concerns regarding this. Thanks.
David J
Note: I made a mistake earlier, and I was able to get this to return true of false based on the success or failure of either operation. This could easily be adjusted to return different messages for the add or update function so that you can tell which of the two processes actually failed.
I hope this helps. Please let me know if you have any questions. Thanks.
David J