$geocode = !(...bunch of stuff...);
says "take that bunch of stuff and evaluate it as a boolean value (ie. true or false). Then negate it (ie. if it's true, make it false; if it's false, make it true)." Check out the documentation for more on logical operators.
So you need to start by looking at the stuff in the parentheses:
$listing // does the listing object exist?
&& $listing->getAddress1() == $commonFieldValues['address_1'] // and does "address1" equal this other thing
&& $listing->getAddress2() == $commonFieldValues['address_2'] // and does "address2" equal this other thing
&& $listing->getCity() == $commonFieldValues['city'] // and does "city" equal this other thing
&& $listing->getState() == $commonFieldValues['state'] // you get the picture...
&& $listing->getZipCode() == $commonFieldValues['zip_code']
If all that is true, then $geocode
is going to be false (because of the !
operator) and your geocoding is only going to take place if $geocode
is true.
I don't know much about your code, but I'd interpret this as saying
If I have a listing and the address doesn't match or the city doesn't match or the state doesn't match or the zip code doesn't match, then I need to geocode it.
So look at your $listing
object (does it exist?) and your $commonFieldValues
array (what are those values and are they what you expect them to be?).