function fn_em_exim_sync($primary_object_ids, $import_data, $auth) { foreach ($import_data as $data) { $data = array_pop($data); // remove index with language code if (empty($data['timestamp'])) { $data['timestamp'] = fn_timestamp_to_date(time()); } EmailSync::instance()->batchAdd(array('email' => $data['email'], 'name' => $data['name'], 'timestamp' => fn_date_to_timestamp($data['timestamp']), 'lang_code' => !empty($data['lang_code']) ? $data['lang_code'] : CART_LANGUAGE, 'ip_address' => !empty($data['ip_address']) ? $data['ip_address'] : '')); } EmailSync::instance()->batchSubscribe(); }
/** * Prepares timestamp field to be imported into DB. Empty strings will be converted to 0. * * @param $timestamp * * @return int Timestamp value */ function fn_exim_put_optional_timestamp($timestamp) { if (empty($timestamp)) { return 0; } else { return fn_date_to_timestamp($timestamp); } }