- Env::t('NAF_code'), Env::i('AX_code'), Env::i('holdingId'), $id);
-
- XDB::execute("INSERT INTO profile_phones (pid, link_type, link_id, tel_id, tel_type,
- search_tel, display_tel, pub)
- VALUES ({?}, 'hq', 0, 0, 'fixed', {?}, {?}, 'public'),
- ({?}, 'hq', 0, 1, 'fax', {?}, {?}, 'public')",
- $id, format_phone_number(Env::v('tel')), $display_tel,
- $id, format_phone_number(Env::v('fax')), $display_fax);
-
- XDB::execute("INSERT INTO profile_addresses (jobid, type, id, accuracy,
- text, postalText, postalCode, localityId,
- subAdministrativeAreaId, administrativeAreaId,
- countryId, latitude, longitude, updateTime,
- north, south, east, west)
- VALUES ({?}, 'hq', 0, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?},
- {?}, {?}, FROM_UNIXTIME({?}), {?}, {?}, {?}, {?})",
- $id, $address['accuracy'], $address['text'], $address['postalText'],
- $address['postalCode'], $address['localityId'],
- $address['subAdministrativeAreaId'], $address['administrativeAreaId'],
- $address['countryId'], $address['latitude'], $address['longitude'],
- $address['updateTime'], $address['north'], $address['south'],
- $address['east'], $address['west']);
+ (Env::t('NAF_code') == 0 ? null : Env::t('NAF_code')),
+ (Env::i('AX_code') == 0 ? null : Env::t('AX_code')),
+ (Env::i('holdingId') == 0 ? null : Env::t('holdingId')), $id);
+
+ $phone = new Phone(array('display' => Env::v('tel'), 'link_id' => $id, 'id' => 0, 'type' => 'fixed',
+ 'link_type' => Phone::LINK_COMPANY, 'pub' => 'public'));
+ $fax = new Phone(array('display' => Env::v('fax'), 'link_id' => $id, 'id' => 1, 'type' => 'fax',
+ 'link_type' => Phone::LINK_COMPANY, 'pub' => 'public'));
+ $address = new Address(array('jobid' => $id, 'type' => Address::LINK_COMPANY, 'text' => Env::t('address')));
+ $phone->save();
+ $fax->save();
+ $address->save();