当前位置: 首页>>代码示例>>PHP>>正文


PHP Contact::setLastName方法代码示例

本文整理汇总了PHP中Contact::setLastName方法的典型用法代码示例。如果您正苦于以下问题:PHP Contact::setLastName方法的具体用法?PHP Contact::setLastName怎么用?PHP Contact::setLastName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Contact的用法示例。


在下文中一共展示了Contact::setLastName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: console_create_user

function console_create_user($args)
{
    $fname = array_shift($args);
    $lname = array_shift($args);
    $email = array_shift($args);
    $admin = array_shift($args) == 'true';
    if (is_null($fname) || is_null($lname) || is_null($email)) {
        throw new Exception('create_user: Missing arguments. Expected: (fname, lname, email, admin)');
    }
    $display_name = $fname . " " . $lname;
    $username = str_replace(" ", "_", strtolower($display_name));
    $user_data = array('username' => $username, 'display_name' => $display_name, 'email' => $email, 'password_generator' => 'random', 'timezone' => 0, 'autodetect_time_zone' => 1, 'create_contact' => false, 'company_id' => owner_company()->getId(), 'send_email_notification' => true, 'personal_project' => 0);
    // array
    try {
        DB::beginWork();
        $user = create_user($user_data, $admin, '');
        if (!$user->getContact() instanceof Contact) {
            $contact = new Contact();
            $contact->setFirstName($fname);
            $contact->setLastName($lname);
            $contact->setEmail($email);
            $contact->setUserId($user->getId());
            $contact->save();
        }
        DB::commit();
    } catch (Exception $e) {
        DB::rollback();
        throw $e;
    }
}
开发者ID:pnagaraju25,项目名称:fengoffice,代码行数:30,代码来源:console.php

示例2: testAddContact

	function testAddContact () {
		/* Creation du contact */
		$contact = new Contact();
		$contact->setEmail("test@test.fr");
		$contact->setFirstName("erwantest");
		$contact->setLastName('dagorntest');
		$ret = $this->sales->add($contact);
		echo '<pre> testAddContact <br>/';
		print_r($contact);
		echo '<br/> retour :'.$ret;
		$this->assertIdentical($ret, true);
		$this->assertIdentical(($contact->getId() != ""), true);
		/* Modification  du contact */
		$contact->setFirstName("erwantestModif");
		$ret = $this->sales->update($contact);
		
		$this->assertIdentical($ret, true);
		/* Suppression du contact */
		$ret = $this->sales->delete($contact->getId());
		$this->assertIdentical($ret, true);
		
	}
开发者ID:r1zib,项目名称:API-Connection,代码行数:22,代码来源:testContactSalesforce.php

示例3: createContact

 private function createContact()
 {
     $contact = new Contact();
     $contact->setEmail($this->getFieldValue('Email'));
     $contact->setLastName($this->getFieldValue('LastName'));
     $contact->setFirstName($this->getFieldValue('FirstName'));
     $contact->setPhone($this->getFieldValue('Telephone'));
     $contact->setSujet($this->getFieldValue('Objet'));
     $contact->setWhatId($this->getFieldValue('whatId'));
     if ($this->getFieldValue('formname') == 'contact_default') {
         $contact->setSujet("Contactez nke : " . $contact->getSujet());
     }
     $corp = "[Origine : " . $this->getCurrentURL() . "]\n" . $this->getFieldValue('Message');
     if ($this->getFieldValue('formname') == 'contact_revendeur') {
         $corp .= "Ville de Résidence : " . $this->getFieldValue('Ville') . "\n" . "Port d'attache : " . $this->getFieldValue('Port') . "\n";
         //"Chantier naval : ".$this->getFieldValue('ChantierNaval')."\n";
     }
     $contact->setTexte($corp);
     return $contact;
 }
开发者ID:r1zib,项目名称:typo3,代码行数:20,代码来源:class.user_azelizcontacts_pi1.php

示例4: ContactsCollection

 function signup_user_constant_contact($firstname, $lastname, $email, $list)
 {
     global $premise_base;
     require_once PREMISE_LIB_DIR . 'constant_contact_api/constant_contact_api.php';
     $settings = $premise_base->get_settings();
     $optin = $settings['optin'];
     $premise_base->setup_constant_contact($this->_optin_ConstantContactKey, $optin['constant-contact-username'], $optin['constant-contact-password']);
     $collection = new ContactsCollection();
     list($search) = $collection->searchByEmail($email);
     if (!empty($search)) {
         foreach ($search as $possible) {
             if ($email == $possible->getEmailAddress()) {
                 $contact = $collection->getContact($possible->getLink());
                 break;
             }
         }
     }
     $listKey = 'http://api.constantcontact.com/ws/customers/' . $optin['constant-contact-username'] . '/lists/' . $list;
     if ($contact) {
         $existingLists = $contact->getLists();
         if (in_array($listKey, $existingLists)) {
             return array('error' => __('You have already subscribed to this mailing list', 'premise'));
         } else {
             $contact->setLists($listKey);
         }
         $contact->setFirstName($firstname);
         $contact->setLastName($lastname);
         $result = $collection->updateContact($contact->getId(), $contact);
     } else {
         $contact = new Contact();
         $contact->setFirstName($firstname);
         $contact->setLastName($lastname);
         $contact->setEmailAddress($email);
         $contact->setLists($listKey);
         $result = $collection->createContact($contact);
     }
     $first = substr((string) $result, 0, 1);
     if ($first != 2) {
         return array('error' => __('Could not subscribe you to this mailing list', 'premise'));
     }
     return true;
 }
开发者ID:juslee,项目名称:e27,代码行数:42,代码来源:class-theme.php

示例5: parseContact

 public function parseContact($contactObject)
 {
     $contact = new Contact();
     $contact->setPhoneNumber($contactObject->phone_number);
     $contact->setFirstName($contactObject->first_name);
     if (property_exists($contactObject, 'last_name')) {
         $contact->setLastName($contactObject->last_name);
     }
     if (property_exists($contactObject, 'user_id')) {
         $contact->setUserId($contactObject->user_id);
     }
     return $contact;
 }
开发者ID:raniongolu,项目名称:Telegram-Bot-Client,代码行数:13,代码来源:Update.php

示例6: submitManagerApplication

    private function submitManagerApplication()
    {
        $request = \Server::getCurrentRequest();
        $vars = $request->getVars();
        $username = $request->getVar('managerUsername');
        $password = $request->getVar('managerPassword');
        $first_name = $request->getVar('contactFirstName');
        $last_name = $request->getVar('contactLastName');
        $email = $request->getVar('emailAddress');
        $phone = $request->getVar('phoneNumber');
        $hours = $request->getVar('contactHours');
        $company_name = $request->getVar('companyName');
        $company_url = $request->getVar('companyUrl');
        $company_address = $request->getVar('companyAddress');
        $private = $request->getVar('managerType');
        $contact = new Contact();
        try {
            $contact->setUsername($username);
            $contact->setPassword($password);
            $contact->setFirstName($first_name);
            $contact->setLastName($last_name);
            $contact->setEmailAddress($email);
            $contact->setPhone($phone);
            $contact->setTimesAvailable($hours);
            if ($private == 'false') {
                $contact->setPrivate(false);
                if (empty($company_name)) {
                    throw \Exception('Missing company name');
                } else {
                    $contact->setCompanyName($company_name);
                }
                if (empty($company_address)) {
                    throw \Exception('Missing company address');
                } else {
                    $contact->setCompanyAddress($company_address);
                }
                $contact->setCompanyUrl($company_url);
            } else {
                $contact->setPrivate(true);
                $contact->setCompanyName('Private Renter');
            }
            $contact->setApproved(false);
            $contact->save();
            $this->emailApprovalNeeded();
        } catch (\Exception $ex) {
            $address = \PHPWS_Settings::get('properties', 'email');
            \Error::log($ex);
            $this->title = 'Sorry!';
            $this->content = <<<EOF
<p>Your manager submission could not be processed. Please email <a href="mailto:{$address}">{$address}</a> to inform them of your problem.</p>
EOF;
            $this->content .= $ex->getMessage();
            return;
        }
        // success
        $this->title = 'Thank you';
        $this->content = <<<EOF
<p>We will review your manager application and email your confirmation.</p>
                <p><a href="./">Return to the home page</a></p>
EOF;
    }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:61,代码来源:Contact_User.php


注:本文中的Contact::setLastName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。