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


PHP Person::setCity方法代码示例

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


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

示例1: executeStepSave

 public function executeStepSave(sfWebRequest $request)
 {
     $passenger_session_step5 = $this->getUser()->getAttribute('passangers_step5');
     if (!$passenger_session_step5) {
         return $this->forward('passanger', 'step5_4');
     }
     //save Person data
     $person = new Person();
     $person->setTitle($passenger_session_step5['title']);
     $person->setFirstName($passenger_session_step5['firstname']);
     $person->setLastName($passenger_session_step5['lastname']);
     $person->setAddress1($passenger_session_step5['address1']);
     $person->setAddress2($passenger_session_step5['address2']);
     $person->setCity($passenger_session_step5['city']);
     $person->setCounty($passenger_session_step5['county']);
     $person->setState($passenger_session_step5['state']);
     $person->setCountry($passenger_session_step5['country']);
     $person->setZipcode($passenger_session_step5['zipcode']);
     $person->setDayPhone($passenger_session_step5['day_phone']);
     $person->setDayComment($passenger_session_step5['day_comment']);
     $person->setEveningPhone($passenger_session_step5['eve_phone']);
     $person->setEveningComment($passenger_session_step5['eve_comment']);
     $person->setMobilePhone($passenger_session_step5['mobile_phone']);
     $person->setMobileComment($passenger_session_step5['mobile_comment']);
     $person->setPagerPhone($passenger_session_step5['pager_phone']);
     $person->setPagerComment($passenger_session_step5['pager_comment']);
     $person->setOtherPhone($passenger_session_step5['other_comment']);
     $person->setOtherComment($passenger_session_step5['other_comment']);
     $person->setFaxPhone1($passenger_session_step5['fax_phone1']);
     $person->setFaxComment1($passenger_session_step5['fax_comment1']);
     $person->setAutoFax($passenger_session_step5['auto_fax']);
     $person->setFaxPhone2($passenger_session_step5['fax_phone2']);
     $person->setFaxComment2($passenger_session_step5['fax_comment2']);
     $person->setEmail($passenger_session_step5['email']);
     $person->setEmailTextOnly($passenger_session_step5['textonly']);
     $person->setEmailBlocked($passenger_session_step5['emailblocked']);
     $person->setComment($passenger_session_step5['comment']);
     $person->setBlockMailings($passenger_session_step5['blockmailings']);
     $person->setNewsletter($passenger_session_step5['newsletter']);
     $person->setGender($passenger_session_step5['gender']);
     $person->setDeceased($passenger_session_step5['deceased']);
     $person->setDeceasedComment($passenger_session_step5['deceased_comment']);
     $person->setSecondaryEmail($passenger_session_step5['secemail']);
     $person->setDeceasedDate($passenger_session_step5['deceased_date']);
     $person->setMiddleName($passenger_session_step5['middlename']);
     $person->setSuffix($passenger_session_step5['suffix']);
     $person->setNickname($passenger_session_step5['nickname']);
     $person->setVeteran($passenger_session_step5['military']);
     $person->save();
     //save Passenger data
     $passenger = new Passenger();
     $passenger->setPersonId($person->getId());
     if ($passenger_session_step5['passenger_type_id'] == 0) {
         $passenger->setPassengerTypeId(null);
     } else {
         $passenger->setPassengerTypeId($passenger_session_step5['passenger_type_id']);
     }
     $passenger->setParent($passenger_session_step5['parent']);
     $passenger->setDateOfBirth($passenger_session_step5['date_of_birth']);
     $passenger->setWeight($passenger_session_step5['weight']);
     $passenger->setIllness($passenger_session_step5['illness']);
     $passenger->setPassengerIllnessCategoryId($passenger_session_step5['passenger_illness_category_id']);
     $passenger->setLanguageSpoken($passenger_session_step5['language_spoken']);
     $passenger->setBestContactMethod($passenger_session_step5['best_contact_method']);
     $passenger->setFinancial($passenger_session_step5['facility_name']);
     $passenger->setPublicConsiderations($passenger_session_step5['public_considerations']);
     $passenger->setPrivateConsiderations($passenger_session_step5['private_considerations']);
     $passenger->setGroundTransportationComment($passenger_session_step5['ground_transportation_comment']);
     $passenger->setTravelHistoryNotes($passenger_session_step5['travel_history_notes']);
     $passenger->setReleasingPhysician($passenger_session_step5['releasing_physician']);
     $passenger->setReleasingPhone($passenger_session_step5['releasing_phone']);
     $passenger->setReleasingFax1($passenger_session_step5['releasing_fax1']);
     $passenger->setReleasingFax1Comment($passenger_session_step5['releasing_fax1_comment']);
     $passenger->setReleasingEmail($passenger_session_step5['releasing_email']);
     $passenger->setNeedMedicalRelease($passenger_session_step5['need_medical_release']);
     $passenger->setMedicalReleaseRequested($passenger_session_step5['medical_release_requested']);
     $passenger->setMedicalReleaseReceived($passenger_session_step5['medical_release_received']);
     $passenger->setTreatingPhysician($passenger_session_step5['treating_physician']);
     $passenger->setTreatingPhone($passenger_session_step5['treating_phone']);
     $passenger->setTreatingFax1($passenger_session_step5['treating_fax1']);
     $passenger->setTreatingFax1Comment($passenger_session_step5['treating_fax1_comment']);
     $passenger->setTreatingEmail($passenger_session_step5['treating_email']);
     $passenger->setLanguageSpoken($passenger_session_step5['language_spoken']);
     $passenger->setLodgingPhone($passenger_session_step5['lodging_phone']);
     $passenger->setLodgingPhoneComment($passenger_session_step5['lodging_phone_comment']);
     $passenger->setFacilityName($passenger_session_step5['facility_name']);
     $passenger->setFacilityPhone($passenger_session_step5['facility_phone']);
     $passenger->setFacilityPhoneComment($passenger_session_step5['facility_phone_comment']);
     $passenger->setEmergencyContactName($passenger_session_step5['emergency_contact_name']);
     $passenger->setEmergencyContactPrimaryPhone($passenger_session_step5['emergency_contact_primary_phone']);
     $passenger->setEmergencyContactPrimaryComment($passenger_session_step5['emergency_contact_primary_comment']);
     $passenger->setEmergencyContactSecondaryPhone($passenger_session_step5['emergency_contact_secondary_phone']);
     $passenger->setEmergencyContactSecondaryComment($passenger_session_step5['emergency_contact_secondary_comment']);
     $passenger->save();
     $key = $passenger_session_step5['key'];
     $this->getUser()->setFlash('success', 'Passenger information has been successfully created!');
     $this->redirect('@passenger');
     //removing used session like passenger data
     unset($passenger_session_step5p[$key]);
     $this->getUser()->setAttribute('passanger_step5', $passenger_session_step5);
//.........这里部分代码省略.........
开发者ID:yasirgit,项目名称:afids,代码行数:101,代码来源:actions.class.php

示例2: register

 public function register($postArr)
 {
     $status = false;
     $firstName = $postArr['firstname'];
     $lastName = $postArr['lastname'];
     if ($postArr['institution'] && !trim(strpos($postArr['institution'], ' ')) && preg_match('/[a-z]+[A-Z]+[a-z]+[A-Z]+/', $postArr['institution'])) {
         if ($postArr['title'] && !trim(strpos($postArr['title'], ' ')) && preg_match('/[a-z]+[A-Z]+[a-z]+[A-Z]+/', $postArr['title'])) {
             return false;
         }
     }
     $person = new Person();
     $person->setPassword($postArr['pwd']);
     $person->setUserName($this->userName);
     $person->setFirstName($firstName);
     $person->setLastName($lastName);
     $person->setTitle($postArr['title']);
     $person->setInstitution($postArr['institution']);
     $person->setCity($postArr['city']);
     $person->setState($postArr['state']);
     $person->setZip($postArr['zip']);
     $person->setCountry($postArr['country']);
     $person->setEmail($postArr['emailaddr']);
     $person->setUrl($postArr['url']);
     $person->setBiography($postArr['biography']);
     $person->setIsPublic(isset($postArr['ispublic']) ? 1 : 0);
     //Add to users table
     $fields = 'INSERT INTO users (';
     $values = 'VALUES (';
     $fields .= 'firstname ';
     $values .= '"' . $this->cleanInStr($person->getFirstName()) . '"';
     $fields .= ', lastname';
     $values .= ', "' . $this->cleanInStr($person->getLastName()) . '"';
     if ($person->getTitle()) {
         $fields .= ', title';
         $values .= ', "' . $this->cleanInStr($person->getTitle()) . '"';
     }
     if ($person->getInstitution()) {
         $fields .= ', institution';
         $values .= ', "' . $this->cleanInStr($person->getInstitution()) . '"';
     }
     if ($person->getDepartment()) {
         $fields .= ', department';
         $values .= ', "' . $this->cleanInStr($person->getDepartment()) . '"';
     }
     if ($person->getAddress()) {
         $fields .= ', address';
         $values .= ', "' . $this->cleanInStr($person->getAddress()) . '"';
     }
     if ($person->getCity()) {
         $fields .= ', city';
         $values .= ', "' . $this->cleanInStr($person->getCity()) . '"';
     }
     $fields .= ', state';
     $values .= ', "' . $this->cleanInStr($person->getState()) . '"';
     $fields .= ', country';
     $values .= ', "' . $this->cleanInStr($person->getCountry()) . '"';
     if ($person->getZip()) {
         $fields .= ', zip';
         $values .= ', "' . $this->cleanInStr($person->getZip()) . '"';
     }
     if ($person->getPhone()) {
         $fields .= ', phone';
         $values .= ', "' . $this->cleanInStr($person->getPhone()) . '"';
     }
     if ($person->getEmail()) {
         $fields .= ', email';
         $values .= ', "' . $this->cleanInStr($person->getEmail()) . '"';
     }
     if ($person->getUrl()) {
         $fields .= ', url';
         $values .= ', "' . $person->getUrl() . '"';
     }
     if ($person->getBiography()) {
         $fields .= ', biography';
         $values .= ', "' . $this->cleanInStr($person->getBiography()) . '"';
     }
     if ($person->getIsPublic()) {
         $fields .= ', ispublic';
         $values .= ', ' . $person->getIsPublic();
     }
     $sql = $fields . ') ' . $values . ')';
     //echo "SQL: ".$sql;
     $editCon = $this->getConnection('write');
     if ($editCon->query($sql)) {
         $person->setUid($editCon->insert_id);
         $this->uid = $person->getUid();
         //Add userlogin
         $sql = 'INSERT INTO userlogin (uid, username, password) ' . 'VALUES (' . $person->getUid() . ', "' . $this->cleanInStr($person->getUserName()) . '", PASSWORD("' . $this->cleanInStr($person->getPassword()) . '"))';
         if ($editCon->query($sql)) {
             $status = true;
             //authenicate
             $this->userName = $person->getUserName();
             $this->displayName = $person->getFirstName();
             $this->reset();
             $this->setCookies();
         } else {
             $this->errorStr = 'FAILED: Unable to create user.<div style="margin-left:55px;">Please contact system administrator for assistance.</div>';
         }
     }
     $editCon->close();
//.........这里部分代码省略.........
开发者ID:jphilip124,项目名称:Symbiota,代码行数:101,代码来源:ProfileManager.php

示例3: Person

 $title = array_key_exists("title", $_REQUEST) ? $_REQUEST["title"] : "";
 $institution = array_key_exists("institution", $_REQUEST) ? $_REQUEST["institution"] : "";
 $city = array_key_exists("city", $_REQUEST) ? $_REQUEST["city"] : "";
 $state = array_key_exists("state", $_REQUEST) ? $_REQUEST["state"] : "";
 $zip = array_key_exists("zip", $_REQUEST) ? $_REQUEST["zip"] : "";
 $country = array_key_exists("country", $_REQUEST) ? $_REQUEST["country"] : "";
 $url = array_key_exists("url", $_REQUEST) ? $_REQUEST["url"] : "";
 $biography = array_key_exists("biography", $_REQUEST) ? $_REQUEST["biography"] : "";
 $isPublic = array_key_exists("ispublic", $_REQUEST) ? $_REQUEST["ispublic"] : "";
 $newPerson = new Person();
 $newPerson->setUid($userId);
 $newPerson->setFirstName($firstname);
 $newPerson->setLastName($lastname);
 $newPerson->setTitle($title);
 $newPerson->setInstitution($institution);
 $newPerson->setCity($city);
 $newPerson->setState($state);
 $newPerson->setZip($zip);
 $newPerson->setCountry($country);
 $newPerson->setEmail($email);
 $newPerson->setUrl($url);
 $newPerson->setBiography($biography);
 $newPerson->setIsPublic($isPublic);
 if (!$pHandler->updateProfile($newPerson)) {
     $statusStr = "Profile update failed!";
 }
 $person = $pHandler->getPerson();
 if ($person->getIsTaxonomyEditor()) {
     $tabIndex = 3;
 } else {
     $tabIndex = 2;
开发者ID:Symbiota,项目名称:Symbiota,代码行数:31,代码来源:viewprofile.php

示例4: URL

 $url = new URL(ADDRESS_SERVICE . '/addresses/parse.php');
 $url->format = 'xml';
 $url->address = $row['address'];
 $parsed = new SimpleXMLElement($url, null, true);
 if ($parsed->street_number && $parsed->street_name) {
     // Look up their address in Master Address
     $url = new URL(ADDRESS_SERVICE . '/home.php');
     $url->queryType = 'address';
     $url->format = 'xml';
     $url->query = $row['address'];
     echo $url->query . " ==> ";
     $xml = new SimpleXMLElement($url, null, true);
     if (count($xml) == 1) {
         // Set the address
         $person->setAddress($xml->address->streetAddress);
         $person->setCity($xml->address->city);
         $person->setState($xml->address->state);
         $person->setZip($xml->address->zip);
         // $person->setStreet_address_id($xml->address->id);
         // See if there's a subunit
         if ($parsed->subunitIdentifier) {
             $subunit = $xml->xpath("//subunit[identifier='{$parsed->subunitIdentifier}']");
             if ($subunit) {
                 // $person->setSubunit_id($subunit[0]['id']);
                 $person->setAddress("{$person->getAddress()} {$subunit[0]->type} {$subunit[0]->identifier}");
             }
         }
         echo "{$person->getAddress()} ==>";
     }
 }
 if (!$person->getAddress()) {
开发者ID:CodeForEindhoven,项目名称:uReport,代码行数:31,代码来源:1_constituents.php

示例5: Course

foreach ($courses as $c) {
    echo $c->getDescription() . "\n";
}
$c = new Course();
$c->setId(1);
$c->load();
echo $c->getDescription() . "\n";
$students = $c->getStudents();
foreach ($students as $s) {
    echo $s->getName() . "\n";
}
//SEARCH
$p = new Person();
$p->setName('Mat');
$search = $p->search();
$search->orderBy('name');
$list = $search->execute();
foreach ($list as $p) {
    echo $p->getName() . "\n";
}
//Recursive Search
$c = new City();
$c->setName('San');
$p = new Person();
$p->setCity($c);
$b = new Book();
$b->setAuthor($p);
$list = $b->search()->execute();
foreach ($list as $b) {
    echo $b->getTitle() . "\n";
}
开发者ID:mateusfornari,项目名称:hypersistence-alpha,代码行数:31,代码来源:index.php

示例6: executeSave

 /**
  * missionRequests save all data into corresponding tables
  * CODE:mission_request_create
  */
 public function executeSave(sfWebRequest $request)
 {
     # security
     if (!$this->getUser()->hasCredential(array('Administrator', 'Staff', 'Coordinator'), false)) {
         $this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer());
         $this->redirect('dashboard/index');
     }
     $miss_req_session = $this->getUser()->getAttribute('miss_req');
     if (!$miss_req_session) {
         return $this->forward('passenger', 'step3');
     }
     //set Requester Person
     $req_person = new Person();
     $req_person->setFirstName($miss_req_session->getReqFirstname());
     $req_person->setLastName($miss_req_session->getReqLastname());
     $req_person->setAddress1($miss_req_session->getReqAddress1());
     $req_person->setAddress2($miss_req_session->getReqAddress2());
     $req_person->setCity($miss_req_session->getReqCity());
     $req_person->setCounty($miss_req_session->getReqCounty());
     $req_person->setState($miss_req_session->getReqState());
     $req_person->setCountry($miss_req_session->getReqCountry());
     $req_person->setZipcode($miss_req_session->getReqZipcode());
     $req_person->setEmail($miss_req_session->getReqEmail());
     $req_person->setSecondaryEmail($miss_req_session->getReqSecondaryEmail());
     $req_person->setPagerEmail($miss_req_session->getReqPagerEmail());
     $req_person->setDayPhone($miss_req_session->getReqDayPhone());
     $req_person->setDayComment($miss_req_session->getReqDayComment());
     $req_person->setEveningPhone($miss_req_session->getReqEvePhone());
     $req_person->setEveningComment($miss_req_session->getReqEveComment());
     $req_person->setMobilePhone($miss_req_session->getReqMobilePhone());
     $req_person->setMobileComment($miss_req_session->getReqMobileComment());
     $req_person->setPagerPhone($miss_req_session->getReqPagerPhone());
     $req_person->setPagerComment($miss_req_session->getReqPagerComment());
     $req_person->setOtherPhone($miss_req_session->getReqOtherPhone());
     $req_person->setOtherComment($miss_req_session->getReqOtherComment());
     $req_person->save();
     //end of Requester Person
     // set Requester Agency
     $agency = AgencyPeer::getByNamePhone(trim($miss_req_session->getAgencyName()));
     if ($agency) {
         # nothing
     } else {
         $agency = new Agency();
         $agency->setName(trim($miss_req_session->getAgencyName()));
         $agency->save();
     }
     //set Requester
     $requester = new Requester();
     $requester->setPersonId($req_person->getId());
     $requester->setAgencyId($agency->getId());
     //$requester->setDischarge($miss_req_session->getReqDischarge());
     $requester->save();
     if (isset($miss_req_session->passenger_id)) {
         $passenger = PassengerPeer::retrieveByPK($miss_req_session->passenger_id);
         if (!$passenger instanceof Passenger) {
             $passenger = new Passenger();
         }
     } else {
         $passenger = new Passenger();
     }
     if ($passenger->isNew()) {
         $person = new Person();
     } else {
         $person = $passenger->getPerson();
     }
     //set Person to Passenger
     $person->setTitle($miss_req_session->getPassTitle());
     $person->setFirstName($miss_req_session->getPassFirstName());
     $person->setLastName($miss_req_session->getPassLastName());
     $person->setGender($miss_req_session->getPassGender());
     $person->setAddress1($miss_req_session->getPassAddress1());
     $person->setAddress2($miss_req_session->getPassAddress2());
     $person->setCity($miss_req_session->getPassCity());
     $person->setState($miss_req_session->getPassState());
     $person->setZipcode($miss_req_session->getPassZipcode());
     $person->setCountry($miss_req_session->getPassCountry());
     $person->setEmail($miss_req_session->getPassEmail());
     $person->setDayPhone($miss_req_session->getPassDayPhone());
     $person->setDayComment($miss_req_session->getPassDayComment());
     $person->setEveningPhone($miss_req_session->getPassEvePhone());
     $person->setEveningComment($miss_req_session->getPassEveComment());
     $person->setMobilePhone($miss_req_session->getPassMobilePhone());
     $person->setMobileComment($miss_req_session->getPassMobileComment());
     $person->setPagerPhone($miss_req_session->getPassPagerPhone());
     $person->setPagerComment($miss_req_session->getPassPagerComment());
     $person->setOtherPhone($miss_req_session->getPassOtherPhone());
     $person->setOtherComment($miss_req_session->getPassOtherComment());
     $person->save();
     //set Passenger
     $passenger->setPersonId($person->getId());
     $passenger->setPassengerTypeId($miss_req_session->getPassType());
     $passenger->setDateOfBirth($miss_req_session->getPassDateOfBirth());
     $passenger->setIllness($miss_req_session->getIllness());
     $passenger->setFinancial($miss_req_session->getFinancial());
     $passenger->setPublicConsiderations($miss_req_session->getPassPublicCons());
     $passenger->setPrivateConsiderations($miss_req_session->getPassPrivateCons());
//.........这里部分代码省略.........
开发者ID:yasirgit,项目名称:afids,代码行数:101,代码来源:actions.class.php

示例7: Person

<?php

$rasmus = new Person();
$rasmus->setName('Rasmus Lerdorf');
$rasmus->setCity('Sunnyvale');
print $rasmus->getName() . ' lives in ' . $rasmus->getCity() . '.';
开发者ID:zmwebdev,项目名称:PHPcookbook-code-3ed,代码行数:6,代码来源:aggregating5.php


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