本文整理汇总了PHP中Company::add方法的典型用法代码示例。如果您正苦于以下问题:PHP Company::add方法的具体用法?PHP Company::add怎么用?PHP Company::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Company
的用法示例。
在下文中一共展示了Company::add方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: importFacebookFriends
/**
* Function to import the facebook contact to ofuz.
* Since Facebook does provide limited information on friends so just the basic
* information will be imported and also keep track of the Facebook user id so that
* for the first time it will just add and on next import it will update.
* @param $fb_friend_id
*/
function importFacebookFriends($friends_data)
{
$do_tag = new Tag();
$do_company = new Company();
$frnd_fb_uid = $friends_data["fb_uid"];
$idcontact = $this->isFbFriendInContact($frnd_fb_uid);
$fname = $friends_data["name"]["first_name"];
$lname = $friends_data["name"]["last_name"];
$work = $friends_data["work"];
$work_detail = $work[0];
$work_history = @$work_detail["work_history"];
$profile_url = @$friends_data["profile_url"][0]["profile_url"];
$profile_pic = @$friends_data["pic_with_logo"][0]["pic_with_logo"];
if (is_array($work_history)) {
$company = $work_history[0]["company_name"];
$position = $work_history[0]["position"];
$desc = $work_history[0]["description"];
}
$list_name = $friends_data['listname'];
$this->firstname = $fname;
$this->lastname = $lname;
$this->fb_userid = $frnd_fb_uid;
$this->iduser = $_SESSION['do_User']->iduser;
if ($idcontact) {
//update the data
$this->checkFbProfileUrlOnUpdate($idcontact, $profile_url);
$this->updateFbProfilePic($idcontact, $profile_pic);
$do_tag->addTagAssociation($idcontact, "Facebook", "contact", $_SESSION['do_User']->iduser);
if (is_array($list_name) && count($list_name) > 0) {
foreach ($list_name as $list_name) {
$do_tag->addTagAssociation($idcontact, $list_name, "contact", $_SESSION['do_User']->iduser);
}
}
$this->getId($idcontact);
if ($company != '' && !empty($company)) {
if ($position != '') {
$this->position = $position;
} else {
$this->position = '';
}
$q = new sqlQuery($this->getDbCon());
$q->query("select idcompany from company where name = '" . trim($company) . "' AND iduser = " . $_SESSION['do_User']->iduser);
if ($q->getNumRows()) {
$q->fetch();
$idcompany = $q->getData("idcompany");
$this->idcompany = $idcompany;
$this->company = trim($company);
$this->update();
$idcontact = $this->getPrimaryKeyValue();
} else {
$do_company->name = trim($company);
$do_company->iduser = $_SESSION['do_User']->iduser;
$do_company->add();
$idcompany = $do_company->getPrimaryKeyValue();
$this->idcompany = $idcompany;
$this->company = trim($company);
$this->update();
}
} else {
$iduser = $_SESSION['do_User']->iduser;
$q = new sqlQuery($this->getDbCon());
$q_upd = "UPDATE contact set firstname = '" . $fname . "',lastname = '" . $lname . "',fb_userid = " . $frnd_fb_uid . ",position = '" . $position . "' where idcontact = " . $idcontact;
$q->query($q_upd);
}
} else {
// new entry
$do_company = new Company();
$do_cont_website = new ContactWebsite();
if ($company != '' && !empty($company)) {
if ($position != '') {
$this->position = $position;
} else {
$this->position = '';
}
$q = new sqlQuery($this->getDbCon());
$q->query("select idcompany from company where name = '" . trim($company) . "' AND iduser = " . $_SESSION['do_User']->iduser);
if ($q->getNumRows()) {
$q->fetch();
$idcompany = $q->getData("idcompany");
$this->idcompany = $idcompany;
$this->company = trim($company);
$this->add();
$idcontact = $this->getPrimaryKeyValue();
$do_cont_website->idcontact = $idcontact;
$do_cont_website->website = $profile_url;
$do_cont_website->website_type = 'Facebook';
$do_cont_website->add();
$this->updateFbProfilePic($idcontact, $profile_pic);
$do_tag->addTagAssociation($idcontact, "Facebook", "contact", $_SESSION['do_User']->iduser);
if (is_array($list_name) && count($list_name) > 0) {
foreach ($list_name as $list_name) {
$do_tag->addTagAssociation($idcontact, $list_name, "contact", $_SESSION['do_User']->iduser);
}
//.........这里部分代码省略.........
示例2: User
case "register":
$name = $_POST['name'];
$tin_number = $_POST['tin_number'];
$address_1 = $_POST['address_1'];
$address_2 = $_POST['address_2'];
$landmark = $_POST['landmark'];
$city = $_POST['city'];
$state = $_POST['state'];
$pincode = $_POST['pincode'];
$email = $_POST['email'];
$fax = $_POST['fax'];
$phone = $_POST['phone'];
$website = $_POST['website'];
$description = "";
//$_POST['description'];
if (Company::add($name, $tin_number, $address_1, $address_2, $landmark, $city, $state, $pincode, $phone, $fax, $email, $website, $description)) {
$mUser = new User();
$username = $_SESSION['user']['username'];
$password = $_SESSION['user']['password'];
$mUser->login($username, $password);
echo "<script>alert('Company registered successfully!!!');</script>";
echo "<script>window.location.href = '../user/login.php'</script>";
//header('Location:../user/login.php');
} else {
echo "<script>alert('Sorry, some error occured.');</script>";
//echo "<script>window.location.href = 'register.php'</script>";
//header('Location:register.php?error=1');
}
break;
case "nocompany":
$mUser = new User();
示例3: eventImportContactsFromCsv
function eventImportContactsFromCsv(EventControler $eventcontroler)
{
$iduser = $eventcontroler->iduser;
$handle = fopen($eventcontroler->targetpath, "r");
$row = 1;
while ($data = fgetcsv($handle)) {
$contact_firstname = "";
$contact_lastname = "";
$contact_company = "";
$company = "";
$contact_position = "";
$contact_summary = "";
$contact_birthday = "";
$contact_city = "";
$contact_state = "";
$contact_street = "";
$contact_zipcode = "";
$contact_country = "";
$contact_address_hm = "";
$contact_address_hm_type = "";
$contact_address_wk = "";
$contact_address_wk_type = "";
$contact_address_ot = "";
$contact_address_ot_type = "";
$contact_email_hm = "";
$contact_email_hm_type = "";
$contact_email_wk = "";
$contact_email_wk_type = "";
$contact_email_ot = "";
$contact_email_ot_type = "";
$contact_phone_hm = "";
$contact_phone_hm_type = "";
$contact_phone_wk = "";
$contact_phone_wk_type = "";
$contact_phone_ot = "";
$contact_phone_ot_type = "";
$contact_phone_mb = "";
$contact_phone_mb_type = "";
$contact_phone_fx = "";
$contact_phone_fx_type = "";
$contact_website_comp = "";
$contact_website_comp_type = "";
$contact_website_blog = "";
$contact_website_blog_type = "";
$contact_website_ot = "";
$contact_website_ot_type = "";
$contact_website_personal = "";
$contact_website_personal_type = "";
$contact_website_twitter = "";
$contact_website_twitter_type = "";
$contact_im_aim_wk = "";
$contact_im_aim_wk_type = "";
$contact_im_aim_per = "";
$contact_im_aim_per_type = "";
$contact_im_aim_ot = "";
$contact_im_aim_ot_type = "";
$im_aim = "";
$contact_im_msn_wk = "";
$contact_im_msn_wk_type = "";
$contact_im_msn_per = "";
$contact_im_msn_per_type = "";
$contact_im_msn_ot = "";
$contact_im_msn_ot_type = "";
$im_msn = "";
$contact_im_icq_wk = "";
$contact_im_icq_wk_type = "";
$contact_im_icq_per = "";
$contact_im_icq_per_type = "";
$contact_im_icq_ot = "";
$contact_im_icq_ot_type = "";
$im_icq = "";
$contact_im_jabber_wk = "";
$contact_im_jabber_wk_type = "";
$contact_im_jabber_per = "";
$contact_im_jabber_per_type = "";
$contact_im_jabber_ot = "";
$contact_im_jabber_ot_type = "";
$im_jabber = "";
$contact_im_yahoo_wk = "";
$contact_im_yahoo_wk_type = "";
$contact_im_yahoo_per = "";
$contact_im_yahoo_per_type = "";
$contact_im_yahoo_ot = "";
$contact_im_yahoo_ot_type = "";
$im_yahoo = "";
$contact_im_skype_wk = "";
$contact_im_skype_wk_type = "";
$contact_im_skype_per = "";
$contact_im_skype_per_type = "";
$contact_im_skype_ot = "";
$contact_im_skype_ot_type = "";
$im_skype = "";
$contact_im_gt_wk = "";
$contact_im_gt_wk_type = "";
$contact_im_gt_per = "";
$contact_im_gt_per_type = "";
$contact_im_gt_ot = "";
$contact_im_gt_ot_type = "";
$im_gt = "";
$contact_note = "";
//.........这里部分代码省略.........
示例4: addslashes
$arrData['phone2'] = addslashes(ucwords($_POST['company_phone2']));
$arrData['fax_no'] = addslashes($_POST['company_faxno']);
$arrData['email1'] = addslashes($_POST['company_email1']);
$arrData['email2'] = addslashes($_POST['company_email2']);
$arrData['profile_link'] = addslashes($_POST['company_profilelink']);
$arrData['aandr'] = addslashes(ucwords($_POST['company_ar']));
$arrData['general_manager'] = addslashes(ucwords($_POST['company_gmanager']));
$arrData['road_manager'] = addslashes(ucwords($_POST['company_rmanager']));
$arrData['administration'] = addslashes(ucwords($_POST['company_administration']));
$arrData['youtube_channel'] = addslashes($_POST['youtube_channel']);
$arrData['soundcloud_username'] = addslashes($_POST['soundcloud_username']);
$arrData['itunes_id'] = addslashes($_POST['itunes_id']);
$arrData['enable_profile'] = addslashes($_POST['enable_profile']);
$arrData['created_date'] = date('Y-m-d H:i:s');
if (empty($_POST['id'])) {
$insert = $company->add($arrData);
if ($insert) {
$logo = '';
$picture = '';
$picture1 = '';
$picture2 = '';
if ($_FILES['company_logo']['name'] != '') {
$logo = 'companylogo_' . $insert . '.jpg';
saveResizeImage($_FILES['company_logo'], $insert, 'companylogo');
}
if ($_FILES['company_picture']['name'] != '') {
$picture = 'companypic_' . $insert . '.jpg';
saveResizeImage($_FILES['company_picture'], $insert, 'companypic');
}
if ($_FILES['company_picture1']['name'] != '') {
$picture1 = 'companypic1_' . $insert . '.jpg';
示例5: add
/**
* @brief Create a new manufacturer
*
* @param Database &$database reference to the database onject
* @param User &$current_user reference to the current user which is logged in
* @param Log &$log reference to the Log-object
* @param string $name the name of the new manufacturer (see Manufacturer::set_name())
* @param integer $parent_id the parent ID of the new manufacturer (see Manufacturer::set_parent_id())
* @param string $address the address of the new manufacturer (see Manufacturer::set_address())
* @param string $phone_number the phone number of the new manufacturer (see Manufacturer::set_phone_number())
* @param string $fax_number the fax number of the new manufacturer (see Manufacturer::set_fax_number())
* @param string $email_address the e-mail address of the new manufacturer (see Manufacturer::set_email_address())
* @param string $website the website of the new manufacturer (see Manufacturer::set_website())
* @param string $auto_product_url the automatic link to the product website (see Company::set_auto_product_url())
*
* @retval Manufacturer the new manufacturer
*
* @throws Exception if (this combination of) values is not valid
* @throws Exception if there was an error
*
* @see DBElement::add()
*/
public static function add(&$database, &$current_user, &$log, $name, $parent_id, $address = '', $phone_number = '', $fax_number = '', $email_address = '', $website = '', $auto_product_url = '')
{
return parent::add($database, $current_user, $log, 'manufacturers', array('name' => $name, 'parent_id' => $parent_id, 'address' => $address, 'phone_number' => $phone_number, 'fax_number' => $fax_number, 'email_address' => $email_address, 'website' => $website, 'auto_product_url' => $auto_product_url));
}
示例6: Contact
function add_contact()
{
$do_api_contact = new Contact();
$do_Contact_View = new ContactView();
$do_api_contact->addNew();
$do_api_contact->firstname = $this->firstname;
$do_api_contact->lastname = $this->lastname;
$do_api_contact->position = $this->position;
$do_api_contact->iduser = $this->iduser;
if ($this->tags != '') {
$tags = explode(",", $this->tags);
}
if ($this->firstname == "" && $this->lastname == "") {
$this->setMessage("610", "First Name OR Last Name is Required");
return false;
} elseif (!$this->iduser) {
$this->setMessage("502", "The User Session is expired");
return false;
} elseif ($idcontact = $do_api_contact->duplicateContact($this->iduser, $this->email_work, $this->email_home, $this->email_other)) {
$this->setMessage("613", "The Contact is duplicated. Contact ID: " . $idcontact);
return false;
} else {
if ($this->company != "") {
$do_api_contact->company = $this->company;
$do_api_company = new Company();
$idcompany = $do_api_company->isDuplicateCompany($this->company, $this->iduser);
if (!$idcompany) {
$do_api_company->addNew();
$do_api_company->iduser = $this->iduser;
$do_api_company->name = trim($this->company);
$do_api_company->add();
$this->idcompany = $do_api_company->getPrimaryKeyValue();
} else {
$this->idcompany = $idcompany;
}
$do_api_contact->idcompany = $this->idcompany;
}
$do_api_contact->add();
$this->idcontact = $do_api_contact->getPrimaryKeyValue();
$do_api_contact->idcontact = $this->idcontact;
//child data starts here
// Phones
if ($this->phone_work != "") {
$do_api_contact->addPhone($this->phone_work, "Work");
}
if ($this->phone_home != "") {
$do_api_contact->addPhone($this->phone_home, "Home");
}
if ($this->mobile_number != "") {
$do_api_contact->addPhone($this->mobile_number, "Mobile");
}
if ($this->fax_number != "") {
$do_api_contact->addPhone($this->fax_number, "Fax");
}
if ($this->phone_other != "") {
$do_api_contact->addPhone($this->phone_other, "Other");
}
//emails
if ($this->email_work != "") {
$do_api_contact->addEmail($this->email_work, "Work");
}
if ($this->email_home != "") {
$do_api_contact->addEmail($this->email_home, "Home");
}
if ($this->email_other != "") {
$do_api_contact->addEmail($this->email_other, "Other");
}
//Website
if ($this->company_website != "") {
$do_api_contact->addWebsite($this->company_website, "Company");
}
if ($this->personal_website != "") {
$do_api_contact->addWebsite($this->personal_website, "Personal");
}
if ($this->blog_url != "") {
$do_api_contact->addWebsite($this->blog_url, "Blog");
}
if ($this->twitter_profile_url != "") {
$do_api_contact->addWebsite($this->twitter_profile_url, "Twitter");
}
if ($this->linkedin_profile_url != "") {
$do_api_contact->addWebsite($this->linkedin_profile_url, "LinkedIn");
}
if ($this->facebook_profile_url != "") {
$do_api_contact->addWebsite($this->facebook_profile_url, "Facebook");
}
// API V.02 will have IM and Address
//Add tags if any
if (is_array($tags)) {
$do_api_tags = new Tag();
foreach ($tags as $tag) {
$do_api_tags->addNew();
$do_api_tags->addTagAssociation($this->idcontact, $tag, "contact", $this->iduser);
}
}
// Ok here the last thing that needs to be done so that the contact should also on the table
$do_Contact_View = new ContactView();
$do_Contact_View->setUser($this->iduser);
$do_api_contact->getId($this->idcontact);
$do_Contact_View->addFromContact($do_api_contact);
//.........这里部分代码省略.........
示例7: updateContactEntry
/**
* Updates a contact entry in ofuz Database.
* @param array,int,int : contact details, contact id, company id
* @return void
* @see class : Company, Contact
*/
function updateContactEntry($entry, $id_contact, $id_company = null)
{
if (!$id_company) {
$new_company = new Company();
$new_company->name = $entry['org_name'];
$new_company->iduser = $this->id_user;
$new_company->add();
$id_company = $new_company->getPrimaryKeyValue();
}
$contact = new Contact();
$contact->getId($id_contact);
// Primarykey id of the record to update
$contact->company = $entry['org_name'];
//do not update name while importing since Gmail has only one text box for the name
//$contact->firstname = $entry['title'];
$contact->idcompany = $id_company;
//$contact->iduser = $this->id_user;
$contact->position = $entry['org_title'];
$contact->update();
$q_contact = new sqlQuery($this->getDbCon());
$sql_sel = "SELECT * FROM contact_address WHERE idcontact = " . $id_contact;
$q_contact->query($sql_sel);
if ($q_contact->getNumRows()) {
while ($q_contact->fetch()) {
if ($q_contact->getData("address_type") == "Home") {
$contact->updateAddress($entry['address_home'], 'Home', $q_contact->getData("idcontact_address"));
}
if ($q_contact->getData("address_type") == "Other") {
$contact->updateAddress($entry['address_other'], 'Other', $q_contact->getData("idcontact_address"));
}
if ($q_contact->getData("address_type") == "Work") {
$contact->updateAddress($entry['address_work'], 'Work', $q_contact->getData("idcontact_address"));
}
}
}
$sql_sel = "SELECT * FROM contact_email WHERE idcontact = " . $id_contact;
$q_contact->query($sql_sel);
if ($q_contact->getNumRows()) {
while ($q_contact->fetch()) {
if ($q_contact->getData("email_type") == "Home") {
$contact->updateEmail($entry['em_home'], 'Home', $q_contact->getData("idcontact_email"));
}
if ($q_contact->getData("email_type") == "Other") {
$contact->updateEmail($entry['em_other'], 'Other', $q_contact->getData("idcontact_email"));
}
if ($q_contact->getData("email_type") == "Work") {
$contact->updateEmail($entry['em_work'], 'Work', $q_contact->getData("idcontact_email"));
}
}
}
$sql_sel = "SELECT * FROM contact_phone WHERE idcontact = " . $id_contact;
$q_contact->query($sql_sel);
if ($q_contact->getNumRows()) {
while ($q_contact->fetch()) {
if ($q_contact->getData("phone_type") == "Home") {
$contact->updatePhone($entry['ph_home'], 'Home', $q_contact->getData("idcontact_phone"));
}
if ($q_contact->getData("phone_type") == "Mobile") {
$contact->updatePhone($entry['ph_mobile'], 'Mobile', $q_contact->getData("idcontact_phone"));
}
if ($q_contact->getData("phone_type") == "Work") {
$contact->updatePhone($entry['ph_work'], 'Work', $q_contact->getData("idcontact_phone"));
}
}
}
}
示例8: insertContact
function insertContact()
{
if ($this->contact['ORG']) {
$id_company = $this->checkCompanyExists($this->contact['ORG']);
$id_company_flag = $id_company ? true : false;
$flag = true;
} else {
$flag = true;
$id_company = 0;
$id_company_flag = true;
}
if ($flag) {
if ($id_company_flag) {
$new_contact = new Contact();
$new_contact->firstname = $this->contact['FULLNAME'];
$new_contact->position = $this->contact['TITLE'];
if ($this->contact['ORG']) {
$company = $this->contact['ORG'];
} else {
$company = "";
}
$new_contact->company = $company;
$new_contact->idcompany = $id_company;
$new_contact->iduser = $this->iduser;
$new_contact->birthday = $this->contact['BDAY'];
$new_contact->picture = $this->contact['PHOTO'];
$new_contact->add();
$lastInsertedContId = $new_contact->getPrimaryKeyValue();
} else {
$new_company = new Company();
$new_company->name = $this->contact['ORG'];
$new_company->iduser = $this->iduser;
$new_company->add();
$new_company_id = $new_company->getPrimaryKeyValue();
$new_contact = new Contact();
$new_contact->firstname = $this->contact['FULLNAME'];
$new_contact->position = $this->contact['TITLE'];
$new_contact->company = $this->contact['ORG'];
$new_contact->idcompany = $new_company_id;
$new_contact->iduser = $this->iduser;
$new_contact->birthday = $this->contact['BDAY'];
$new_contact->picture = $this->contact['PHOTO'];
$new_contact->add();
$lastInsertedContId = $new_contact->getPrimaryKeyValue();
}
if ($this->contact['TELL_WORK']) {
$new_contact->addPhone($this->contact['TELL_WORK'], 'Work');
}
if ($this->contact['TELL_HOME']) {
$new_contact->addPhone($this->contact['TELL_HOME'], 'Home');
}
if ($this->contact['TELL_FAX']) {
$new_contact->addPhone($this->contact['TELL_FAX'], 'Fax');
}
if ($this->contact['TELL_CELL']) {
$new_contact->addPhone($this->contact['TELL_CELL'], 'Mobile');
}
if ($this->contact['TELL_OTHER']) {
$new_contact->addPhone($this->contact['TELL_OTHER'], 'Other');
}
if ($this->contact['ADR_WORK']) {
$new_contact->addAddress($this->contact['ADR_WORK'], 'Work');
}
if ($this->contact['ADR_HOME']) {
$new_contact->addAddress($this->contact['ADR_HOME'], 'Home');
}
if ($this->contact['ADR_OTHER']) {
$new_contact->addAddress($this->contact['ADR_OTHER'], 'Other');
}
if ($this->contact['EMAIL_WORK']) {
$new_contact->addEmail($this->contact['EMAIL_WORK'], 'Work');
}
if ($this->contact['EMAIL_HOME']) {
$new_contact->addEmail($this->contact['EMAIL_HOME'], 'Home');
}
if ($this->contact['EMAIL_OTHER']) {
$new_contact->addEmail($this->contact['EMAIL_OTHER'], 'Other');
}
$do_tag = new Tag();
if ($this->contact['CATEGORIES']) {
$contact_tag = explode(",", $this->contact['CATEGORIES']);
$arr_import_tags = explode(",", $_SESSION['import_tag']);
foreach ($arr_import_tags as $imp_tag) {
array_push($contact_tag, $imp_tag);
}
foreach ($contact_tag as $tag) {
$tag = trim($tag);
$do_tag->addTagAssociation($lastInsertedContId, $tag, "contact", $this->iduser);
}
} else {
$arr_import_tags = explode(",", $_SESSION['import_tag']);
foreach ($arr_import_tags as $tag) {
$tag = trim($tag);
$do_tag->addTagAssociation($lastInsertedContId, $tag, "contact", $this->iduser);
}
}
$do_cont_view = new ContactView();
$do_cont_view->addFromContact($new_contact);
$do_cont_view->updateFromContact($new_contact);
// Added the method call updateFromContact() so that the child data is updated just after insert
//.........这里部分代码省略.........
示例9: eventImportAccount
function eventImportAccount(EventControler $evtcl)
{
$msg = "";
$uploaded_file = $_FILES['fields']['name']['import_account'];
$target_path = 'files/' . $uploaded_file;
if (!move_uploaded_file($_FILES['fields']['tmp_name']['import_account'], $target_path)) {
$msg = "There was an error uploading the file, please try again!";
} else {
chmod($target_path, 0755);
if (file_exists($target_path)) {
//$xml = simplexml_load_file($_SERVER['DOCUMENT_ROOT']."/".$target_path);
$str_xml = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/" . $target_path);
$str_xml = preg_replace('/[^(\\x20-\\x7F)]*/', '', $str_xml);
$xml = simplexml_load_string($str_xml);
echo '<pre>';
print_r($xml);
echo '</pre>';
die;
if ($xml !== FALSE) {
$c_cnt = count($xml->contact);
if ($c_cnt) {
for ($i = 0; $i < $c_cnt; $i++) {
$do_contact = new Contact();
$contact = $xml->contact[$i];
$do_contact->firstname = $contact->firstname;
$do_contact->lastname = $contact->lastname;
$do_contact->position = $contact->position;
$do_contact->company = $contact->company;
$do_contact->idcompany = $contact->idcompany;
$do_contact->iduser = $_SESSION['do_User']->iduser;
$do_contact->picture = $contact->picture;
$do_contact->summary = $contact->summary;
$do_contact->birthday = $contact->birthday;
$do_contact->portal_code = $contact->portal_code;
$do_contact->fb_userid = $contact->fb_userid;
$do_contact->tw_user_id = $contact->tw_user_id;
$do_contact->email_optout = $contact->email_optout;
$do_contact->add();
$lastInsertedContId = $do_contact->getPrimaryKeyValue();
/**
*Contact Address
*/
$ca_cnt = count($contact->contact_address);
if ($ca_cnt) {
for ($ca_cnt_i = 0; $ca_cnt_i < $ca_cnt; $ca_cnt_i++) {
$do_contact_address = new ContactAddress();
$contact_address = $contact->contact_address[$ca_cnt_i];
$do_contact_address->city = $contact_address->city;
$do_contact_address->country = $contact_address->country;
$do_contact_address->state = $contact_address->state;
$do_contact_address->street = $contact_address->street;
$do_contact_address->zipcode = $contact_address->zipcode;
$do_contact_address->idcontact = $lastInsertedContId;
$do_contact_address->address = $contact_address->address;
$do_contact_address->address_type = $contact_address->address_type;
$do_contact_address->add();
$do_contact_address->free();
}
}
/**
*Contact Email
*/
$ce_cnt = count($contact->contact_email);
if ($ce_cnt) {
for ($ce_cnt_i = 0; $ce_cnt_i < $ce_cnt; $ce_cnt_i++) {
$do_contact_email = new ContactEmail();
$contact_email = $contact->contact_email[$ce_cnt_i];
$do_contact_email->idcontact = $lastInsertedContId;
$do_contact_email->email_address = $contact_email->email_address;
$do_contact_email->email_type = $contact_email->email_type;
$do_contact_email->email_isdefault = $contact_email->email_isdefault;
$do_contact_email->add();
$do_contact_email->free();
}
}
/**
*Contact Phone
*/
$cp_cnt = count($contact->contact_phone);
if ($cp_cnt) {
for ($cp_cnt_i = 0; $cp_cnt_i < $cp_cnt; $cp_cnt_i++) {
$do_contact_phone = new ContactPhone();
$contact_phone = $contact->contact_phone[$cp_cnt_i];
$do_contact_phone->phone_number = $contact_phone->phone_number;
$do_contact_phone->phone_type = $contact_phone->phone_type;
$do_contact_phone->idcontact = $lastInsertedContId;
$do_contact_phone->add();
$do_contact_phone->free();
}
}
/**
*Contact Note
*/
$cn_cnt = count($contact->contact_note);
if ($cn_cnt) {
for ($cn_cnt_i = 0; $cn_cnt_i < $cn_cnt; $cn_cnt_i++) {
$do_contact_note = new ContactNotes();
$contact_note = $contact->contact_note[$cn_cnt_i];
$do_contact_note->idcontact = $lastInsertedContId;
$do_contact_note->note = $contact_note->note;
//.........这里部分代码省略.........