+ XDB::execute('INSERT IGNORE INTO profile_addresses (pid, jobid, groupid, type, id, flags, text, postalText, pub, comment,
+ types, formatted_address, location_type, partial_match, latitude, longitude,
+ southwest_latitude, southwest_longitude, northeast_latitude, northeast_longitude,
+ geocoding_date, geocoding_calls)
+ VALUES ({?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?},
+ {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, NOW(), {?})',
+ $this->pid, $this->jobid, $this->groupid, $this->type, $this->id, $this->flags, $this->text, $this->postalText, $this->pub, $this->comment,
+ $this->types, $this->formatted_address, $this->location_type, $this->partial_match, $this->latitude, $this->longitude,
+ $this->southwest_latitude, $this->southwest_longitude, $this->northeast_latitude, $this->northeast_longitude, $this->geocoding_calls);
+
+ if ($this->componentsIds) {
+ foreach (explode(',', $this->componentsIds) as $component_id) {
+ XDB::execute('INSERT IGNORE INTO profile_addresses_components (pid, jobid, groupid, type, id, component_id)
+ VALUES ({?}, {?}, {?}, {?}, {?}, {?})',
+ $this->pid, $this->jobid, $this->groupid, $this->type, $this->id, $component_id);
+ }
+ } else {
+ // If the address was not geocoded, notifies it to the appropriate ML.
+ $mailer = new PlMailer('profile/no_geocoding.mail.tpl');
+ $mailer->assign('text', $this->text);
+ $mailer->assign('primary_key', $this->pid . '-' . $this->jobid . '-' . $this->groupid . '-' . $this->type . '-' . $this->id);
+ $mailer->send();