- $display_tel = format_display_number($this->tel, $error_tel);
- $display_fax = format_display_number($this->fax, $error_fax);
- 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')",
- $jobid, format_phone_number($this->tel), $display_tel,
- $jobid, format_phone_number($this->fax), $display_fax);
+ $phone = new Phone(array('link_type' => 'hq', 'link_id' => $jobid, 'id' => 0,
+ 'type' => 'fixed', 'display' => $this->tel, 'pub' => 'public'));
+ $fax = new Phone(array('link_type' => 'hq', 'link_id' => $jobid, 'id' => 1,
+ 'type' => 'fax', 'display' => $this->fax, 'pub' => 'public'));
+ $phone->save();
+ $fax->save();