本文整理汇总了PHP中Person::setFirstName方法的典型用法代码示例。如果您正苦于以下问题:PHP Person::setFirstName方法的具体用法?PHP Person::setFirstName怎么用?PHP Person::setFirstName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Person
的用法示例。
在下文中一共展示了Person::setFirstName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
protected function execute($arguments = array(), $options = array())
{
// initialize the database connection
$databaseManager = new sfDatabaseManager($this->configuration);
$connection = $databaseManager->getDatabase($options['connection'] ? $options['connection'] : null)->getConnection();
$names = array('Martin', 'Pedro', 'Lucas', 'Agustin', 'Cristian', 'Matias', 'Tomas', 'Cludio', 'Nancy', 'Emilia', 'Alejandra', 'Barbara', 'Luciana', 'Lucia', 'Belen', 'Natalia', 'Adriana', 'Patricio', 'Diego', 'Gonzalo', 'Juan', 'Pablo');
$last_names = array('Ramirez', 'Rodriguez', 'Cordoba', 'Brown', 'Osorio', 'Diaz', 'Ayesa', 'Ramirez', 'Perez', 'Ripoll', 'Bottini', 'Ponce', 'Casella', 'Martinez', 'Erviti', 'Rodgriguez', 'Gonzalez', 'Fernandez', 'Benitez');
$this->createContextInstance('backend');
for ($i = 1; $i <= 100; $i++) {
$person = new Person();
$person->setLastname($last_names[rand(0, 18)]);
$person->setFirstName($names[rand(0, 21)]);
$person->setIdentificationType(1);
$person->setIdentificationNumber($i);
$person->setSex(rand(1, 2));
$person->setBirthDate('2000-06-30');
$student = new Student();
$student->setGlobalFileNumber($i);
$student->setPerson($person);
$person->save();
$student->save();
$this->logSection("Person created", $person->__toString());
}
// add your code here
}
示例2: testSettersAndGetters
public function testSettersAndGetters()
{
$max = new Person('Max', 'Mustermann', Person::GENDER_MALE);
$max->setFirstName('Maxi');
$this->assertEquals('Maxi', $max->getFirstName());
$max->setLastName('Mustermännchen');
$this->assertEquals('Mustermännchen', $max->getLastName());
$max->setGender(Person::GENDER_FEMALE);
$this->assertEquals(Person::GENDER_FEMALE, $max->getGender());
}
示例3: Main
//.........这里部分代码省略.........
$this->formArray[$key] = $value;
}
}
}
}
break;
case "save":
if ($this->formArray["verifiedByID"] != "" && $this->formArray["verifiedByID"] != "xx" && $this->formArray["propertyID"] != "") {
$this->saveVerified($this->formArray["afsID"], $this->formArray["verifiedByID"], $this->formArray["propertyID"]);
}
$ImprovementsBuildingsEncode = new SoapObject(NCCBIZ . "ImprovementsBuildingsEncode.php", "urn:Object");
if ($this->formArray["propertyID"] != "") {
$ImprovementsBuildingsDetails = new SoapObject(NCCBIZ . "ImprovementsBuildingsDetails.php", "urn:Object");
if (!($xmlStr = $ImprovementsBuildingsDetails->getImprovementsBuildings($this->formArray["propertyID"]))) {
$this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
$this->tpl->set_var("TableBlock", "record not found");
} else {
if (!($domDoc = domxml_open_mem($xmlStr))) {
$this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
$this->tpl->set_var("TableBlock", "error xmlDoc");
} else {
$address = new Address();
$address->setAddressID($this->formArray["addressID"]);
$address->setNumber($this->formArray["number"]);
$address->setStreet($this->formArray["street"]);
$address->setBarangay($this->formArray["barangay"]);
$address->setDistrict($this->formArray["district"]);
$address->setMunicipalityCity($this->formArray["municipalityCity"]);
$address->setProvince($this->formArray["province"]);
$address->setDomDocument();
$propertyAdministrator = new Person();
$propertyAdministrator->setPersonID($this->formArray["personID"]);
$propertyAdministrator->setLastName($this->formArray["lastName"]);
$propertyAdministrator->setFirstName($this->formArray["firstName"]);
$propertyAdministrator->setMiddleName($this->formArray["middleName"]);
//$propertyAdministrator->setGender($this->formArray["gender"]);
//$propertyAdministrator->setBirthday($this->birthdate);
//$propertyAdministrator->setMaritalStatus($this->formArray["maritalStatus"]);
//$propertyAdministrator->setTin($this->formArray["tin"]);
$propertyAdministrator->setAddressArray($address);
$propertyAdministrator->setTelephone($this->formArray["telephone"]);
//$propertyAdministrator->setMobileNumber($this->formArray["mobileNumber"]);
$propertyAdministrator->setEmail($this->formArray["email"]);
$propertyAdministrator->setDomDocument();
$improvementsBuildings = new ImprovementsBuildings();
$improvementsBuildings->parseDomDocument($domDoc);
$improvementsBuildings->setPropertyID($this->formArray["propertyID"]);
$improvementsBuildings->setAfsID($this->formArray["afsID"]);
$improvementsBuildings->setArpNumber($this->formArray["arpNumber"]);
$improvementsBuildings->setPropertyIndexNumber($this->formArray["propertyIndexNumber"]);
$improvementsBuildings->setPropertyAdministrator($propertyAdministrator);
$improvementsBuildings->setVerifiedBy($this->formArray["verifiedByID"]);
$improvementsBuildings->setPlottingsBy($this->formArray["plottingsByID"]);
$improvementsBuildings->setNotedBy($this->formArray["notedByID"]);
$improvementsBuildings->setMarketValue($this->formArray["marketValue"]);
$improvementsBuildings->setKind($this->formArray["kind"]);
$improvementsBuildings->setActualUse($this->formArray["actualUse"]);
$improvementsBuildings->setAdjustedMarketValue($this->formArray["adjustedMarketValue"]);
$improvementsBuildings->setAssessmentLevel($this->formArray["assessmentLevel"]);
$improvementsBuildings->setAssessedValue($this->formArray["assessedValue"]);
$improvementsBuildings->setPreviousOwner($this->formArray["previousOwner"]);
$improvementsBuildings->setPreviousAssessedValue($this->formArray["previousAssessedValue"]);
$improvementsBuildings->setTaxability($this->formArray["taxability"]);
$improvementsBuildings->setEffectivity($this->formArray["effectivity"]);
$improvementsBuildings->setAppraisedBy($this->formArray["appraisedByID"]);
$improvementsBuildings->setAppraisedByDate($this->formArray["appraisedByDate"]);
示例4: Person
if ($action == "Submit Edits") {
$firstname = $_REQUEST["firstname"];
$lastname = $_REQUEST["lastname"];
$email = $_REQUEST["email"];
$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();
示例5: Person
<?php
require_once 'autoload.php';
$person = new Person();
$person->setFirstName('Peter');
$person->setSurName('Pan');
echo $person->getInfo();
$person2 = new Person();
$person2->setFirstName('Capitan');
$person2->setSurName('Hook');
echo $person2->getInfo();
$vehicle = new Vehicle();
$vehicle->setDescription('Very nice vehicle');
echo $vehicle->getDescription() . PHP_EOL;
示例6: Main
function Main()
{
switch ($this->formArray["formAction"]) {
case "edit":
$PersonDetails = new SoapObject(NCCBIZ . "PersonDetails.php", "urn:Object");
if (!($xmlStr = $PersonDetails->getPersonDetails($this->formArray["personID"]))) {
$this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
$this->tpl->set_var("TableBlock", "record not found");
} else {
if (!($domDoc = domxml_open_mem($xmlStr))) {
$this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
$this->tpl->set_var("TableBlock", "error xmlDoc");
} else {
$person = new Person();
$person->parseDomDocument($domDoc);
list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $person->getBirthday());
$this->formArray["personID"] = $person->getPersonID();
$this->formArray["lastName"] = $person->getLastName();
$this->formArray["firstName"] = $person->getFirstName();
$this->formArray["middleName"] = $person->getMiddleName();
$this->formArray["gender"] = $person->getGender();
$this->formArray["birth_year"] = removePreZero($dateArr["year"]);
$this->formArray["birth_month"] = removePreZero($dateArr["month"]);
$this->formArray["birth_day"] = removePreZero($dateArr["day"]);
$this->formArray["maritalStatus"] = $person->getMaritalStatus();
$this->formArray["tin"] = $person->getTin();
$address = $person->addressArray[0];
if (is_a($address, Address)) {
$this->formArray["addressID"] = $address->getAddressID();
$this->formArray["number"] = $address->getNumber();
$this->formArray["street"] = $address->getStreet();
$this->formArray["barangay"] = $address->getBarangay();
$this->formArray["district"] = $address->getDistrict();
$this->formArray["municipalityCity"] = $address->getMunicipalitycity();
$this->formArray["province"] = $address->getProvince();
}
$this->formArray["telephone"] = $person->getTelephone();
$this->formArray["mobileNumber"] = $person->getMobileNumber();
$this->formArray["email"] = $person->getEmail();
}
}
break;
case "save":
$PersonEncode = new SoapObject(NCCBIZ . "PersonEncode.php", "urn:Object");
if ($this->formArray["personID"] != "") {
$PersonDetails = new SoapObject(NCCBIZ . "PersonDetails.php", "urn:Object");
if (!($xmlStr = $PersonDetails->getPersonDetails($this->formArray["personID"]))) {
$this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
$this->tpl->set_var("TableBlock", "record not found");
} else {
if (!($domDoc = domxml_open_mem($xmlStr))) {
$this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
$this->tpl->set_var("TableBlock", "error xmlDoc");
} else {
$person = new Person();
$person->parseDomDocument($domDoc);
$address = $person->addressArray[0];
if (is_a($address, Address)) {
$address->setAddressID($this->formArray["addressID"]);
$address->setNumber($this->formArray["number"]);
$address->setStreet($this->formArray["street"]);
$address->setBarangay($this->formArray["barangay"]);
$address->setDistrict($this->formArray["district"]);
$address->setMunicipalityCity($this->formArray["municipalityCity"]);
$address->setProvince($this->formArray["province"]);
$address->setDomDocument();
}
$person->setPersonID($this->formArray["personID"]);
$person->setLastName($this->formArray["lastName"]);
$person->setFirstName($this->formArray["firstName"]);
$person->setMiddleName($this->formArray["middleName"]);
$person->setGender($this->formArray["gender"]);
$person->setBirthday($this->birthdate);
$person->setMaritalStatus($this->formArray["maritalStatus"]);
$person->setTin($this->formArray["tin"]);
$person->setAddressArray($address);
$person->setTelephone($this->formArray["telephone"]);
$person->setMobileNumber($this->formArray["mobileNumber"]);
$person->setEmail($this->formArray["email"]);
$person->setDomDocument();
$doc = $person->getDomDocument();
$xmlStr = $doc->dump_mem(true);
if (!($ret = $PersonEncode->updatePerson($xmlStr))) {
exit("error update");
}
}
}
} else {
$address = new Address();
$address->setNumber($this->formArray["number"]);
$address->setStreet($this->formArray["street"]);
$address->setBarangay($this->formArray["barangay"]);
$address->setDistrict($this->formArray["district"]);
$address->setMunicipalityCity($this->formArray["municipalityCity"]);
$address->setProvince($this->formArray["province"]);
$address->setDomDocument();
$person = new Person();
$person->setPersonID($this->formArray["personID"]);
$person->setLastName($this->formArray["lastName"]);
$person->setFirstName($this->formArray["firstName"]);
//.........这里部分代码省略.........
示例7: Main
//.........这里部分代码省略.........
$this->tpl->set_var("oldNewUserRowspan", 2);
$this->tpl->parse("NewUserPasswordBlock", "NewUserPassword", true);
$this->tpl->set_var("OldUserPasswordBlock", "");
}
break;
}
$PersonEncode = new SoapObject(NCCBIZ . "PersonEncode.php", "urn:Object");
if ($this->formArray["personID"] != "") {
$PersonDetails = new SoapObject(NCCBIZ . "PersonDetails.php", "urn:Object");
if (!($xmlStr = $PersonDetails->getPersonDetails($this->formArray["personID"]))) {
$this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
$this->tpl->set_var("TableBlock", "Person record not found");
} else {
if (!($domDoc = domxml_open_mem($xmlStr))) {
$this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
$this->tpl->set_var("TableBlock", "error xmlDoc");
} else {
$person = new Person();
$person->parseDomDocument($domDoc);
$address = $person->addressArray[0];
if (is_a($address, Address)) {
$address->setAddressID($this->formArray["addressID"]);
$address->setNumber($this->formArray["number"]);
$address->setStreet($this->formArray["street"]);
$address->setBarangay($this->formArray["barangay"]);
$address->setDistrict($this->formArray["district"]);
$address->setMunicipalityCity($this->formArray["municipalityCity"]);
$address->setProvince($this->formArray["province"]);
$address->setDomDocument();
}
$person->setPersonID($this->formArray["personID"]);
$person->setPersonType("adminUser");
$person->setLastName($this->formArray["lastName"]);
$person->setFirstName($this->formArray["firstName"]);
$person->setMiddleName($this->formArray["middleName"]);
$person->setGender($this->formArray["gender"]);
$person->setBirthday($this->birthdate);
$person->setMaritalStatus($this->formArray["maritalStatus"]);
$person->setTin($this->formArray["tin"]);
$person->setAddressArray($address);
$person->setTelephone($this->formArray["telephone"]);
$person->setMobileNumber($this->formArray["mobileNumber"]);
$person->setEmail($this->formArray["email"]);
$person->setDomDocument();
$doc = $person->getDomDocument();
//echo $doc->html_dump_mem();
$xmlStr = $doc->dump_mem(true);
if (!($ret = $PersonEncode->updatePerson($xmlStr))) {
exit("error update");
}
}
}
} else {
$address = new Address();
$address->setNumber($this->formArray["number"]);
$address->setStreet($this->formArray["street"]);
$address->setBarangay($this->formArray["barangay"]);
$address->setDistrict($this->formArray["district"]);
$address->setMunicipalityCity($this->formArray["municipalityCity"]);
$address->setProvince($this->formArray["province"]);
$address->setDomDocument();
$person = new Person();
$person->setPersonID($this->formArray["personID"]);
$person->setPersonType("adminUser");
$person->setLastName($this->formArray["lastName"]);
$person->setFirstName($this->formArray["firstName"]);
示例8: setName
function setName(Person $person, $name)
{
$person->setFirstName($name);
}
示例9: Main
//.........这里部分代码省略.........
$this->formArray[$key] = $value;
}
}
}
}
break;
case "save":
if ($this->formArray["verifiedByID"] != "" && $this->formArray["verifiedByID"] != "xx" && $this->formArray["propertyID"] != "") {
$this->saveVerified($this->formArray["afsID"], $this->formArray["verifiedByID"], $this->formArray["propertyID"]);
}
$PlantsTreesEncode = new SoapObject(NCCBIZ . "PlantsTreesEncode.php", "urn:Object");
if ($this->formArray["propertyID"] != "") {
$PlantsTreesDetails = new SoapObject(NCCBIZ . "PlantsTreesDetails.php", "urn:Object");
if (!($xmlStr = $PlantsTreesDetails->getPlantsTrees($this->formArray["propertyID"]))) {
$this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
$this->tpl->set_var("TableBlock", "record not found");
} else {
if (!($domDoc = domxml_open_mem($xmlStr))) {
$this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
$this->tpl->set_var("TableBlock", "error xmlDoc");
} else {
$address = new Address();
$address->setAddressID($this->formArray["addressID"]);
$address->setNumber($this->formArray["number"]);
$address->setStreet($this->formArray["street"]);
$address->setBarangay($this->formArray["barangay"]);
$address->setDistrict($this->formArray["district"]);
$address->setMunicipalityCity($this->formArray["municipalityCity"]);
$address->setProvince($this->formArray["province"]);
$address->setDomDocument();
$propertyAdministrator = new Person();
$propertyAdministrator->setPersonID($this->formArray["personID"]);
$propertyAdministrator->setLastName($this->formArray["lastName"]);
$propertyAdministrator->setFirstName($this->formArray["firstName"]);
$propertyAdministrator->setMiddleName($this->formArray["middleName"]);
//$propertyAdministrator->setGender($this->formArray["gender"]);
//$propertyAdministrator->setBirthday($this->birthdate);
//$propertyAdministrator->setMaritalStatus($this->formArray["maritalStatus"]);
//$propertyAdministrator->setTin($this->formArray["tin"]);
$propertyAdministrator->setAddressArray($address);
$propertyAdministrator->setTelephone($this->formArray["telephone"]);
//$propertyAdministrator->setMobileNumber($this->formArray["mobileNumber"]);
$propertyAdministrator->setEmail($this->formArray["email"]);
$propertyAdministrator->setDomDocument();
$plantsTrees = new PlantsTrees();
$plantsTrees->parseDomDocument($domDoc);
$plantsTrees->setPropertyID($this->formArray["propertyID"]);
$plantsTrees->setAfsID($this->formArray["afsID"]);
$plantsTrees->setArpNumber($this->formArray["arpNumber"]);
$plantsTrees->setPropertyIndexNumber($this->formArray["propertyIndexNumber"]);
$plantsTrees->setPropertyAdministrator($propertyAdministrator);
$plantsTrees->setVerifiedBy($this->formArray["verifiedByID"]);
$plantsTrees->setPlottingsBy($this->formArray["plottingsByID"]);
$plantsTrees->setNotedBy($this->formArray["notedByID"]);
$plantsTrees->setMarketValue($this->formArray["marketValue"]);
$plantsTrees->setKind($this->formArray["kind"]);
$plantsTrees->setActualUse($this->formArray["actualUse"]);
$plantsTrees->setAdjustedMarketValue($this->formArray["adjustedMarketValue"]);
$plantsTrees->setAssessmentLevel($this->formArray["assessmentLevel"]);
$plantsTrees->setAssessedValue($this->formArray["assessedValue"]);
$plantsTrees->setPreviousOwner($this->formArray["previousOwner"]);
$plantsTrees->setPreviousAssessedValue($this->formArray["previousAssessedValue"]);
$plantsTrees->setTaxability($this->formArray["taxability"]);
$plantsTrees->setEffectivity($this->formArray["effectivity"]);
$plantsTrees->setAppraisedBy($this->formArray["appraisedByID"]);
$plantsTrees->setAppraisedByDate($this->formArray["appraisedByDate"]);
示例10: urlencode
//$p = implode(",", array_slice(explode(",", $p), 0, 2));
//echo $p."\n";
$parser = new HumanNameParser_Parser($p);
$searchURL = "/peoplefinderWS/peoplefinderws.asmx/PeopleFinderXml?firstName=" . urlencode($parser->getFirst()) . "&lastname=" . urlencode($parser->getLast()) . "&department=&phoneno=&email=";
$peopleInfoXML = file_get_contents($baseURL . $searchURL, false, $context) or die("The mospace server might failed\n");
//echo $baseURL.$searchURL;
$peopleInfoXMLObject = simplexml_load_string($peopleInfoXML, null, LIBXML_NOCDATA);
if ($peopleInfoXMLObject['found'] == 0 || $peopleInfoXMLObject['found'] >= 49) {
continue;
}
//echo "<pre>";
///print_r($peopleInfoXMLObject->Person);
//echo "</pre>";
$personObject = new Person();
$personObject->setLastName($parser->getLast());
$personObject->setFirstName($parser->getFirst());
//For test purpose only
//echo $personObject->getLastName().", ".$personObject->getFirstName()."; ";
$personObject->setDepartment($peopleInfoXMLObject->Person->Department);
$personObject->setTitle($peopleInfoXMLObject->Person->Title);
//$personObject->setImageURL("http://freelanceme.net/Images/default%20profile%20picture.png");
if ($peopleInfoXMLObject->Person->Phone != null) {
$personObject->setPhone($peopleInfoXMLObject->Person->Phone);
}
$personObject->setEmail($peopleInfoXMLObject->Person->{'E-mail'});
$personObject->insertToDatabase();
}
echo "\n";
//For testing purpose only
//if($i++ > 10){
//break;
示例11: 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());
//.........这里部分代码省略.........
示例12: __construct
protected $firstName;
protected $lastName;
public function __construct($firstName, $lastName)
{
$this->setFirstName($firstName);
$this->setLastName($lastName);
}
protected function setFirstName($firstName)
{
$this->firstName = trim($firstName);
}
protected function setLastName($lastName)
{
$this->lastName = trim($lastName);
}
protected function getFirstName($firstName)
{
return $this->firstName;
}
protected function getLastName($lastName)
{
return $this->lastName;
}
public function fullName()
{
return $this->getFirstName . " " . $this->getLastName;
}
}
$person = new Person('John', 'Doe');
echo $person->setFirstName('Jane');
示例13: Address
$address->setDistrict("xOrtigas Center");
$address->setMunicipalityCity("xPasig City");
$address->setProvince("xMetro Manila");
$address->setDomDocument();
$address1 = new Address();
//$address->setAddressID(124);
$address1->setNumber("unit 2415 Megaplaza Building");
$address1->setStreet("ADB Avenue corner Garnett Street");
$address1->setBarangay("Barangay San Antonio");
$address1->setDistrict("Ortigas Center");
$address1->setMunicipalityCity("Pasig City");
$address1->setProvince("Metro Manila");
$address1->setDomDocument();
$person = new Person();
//$person->setPersonID(126);
$person->setFirstName("Nelson Juan");
$person->setMiddleName("Miranda");
$person->setLastName(date("H:i:s"));
$person->setGender("male");
$person->setBirthday("1977/07/09");
$person->setMaritalStatus("single");
$person->setTin("1234567890");
$person->setTelephone("026584746");
$person->setMobileNumber("09175302791");
$person->setEmail("nelson@k2ia.com");
$person->setAddressArray($address);
$person->setAddressArray($address1);
$person->setDomDocument();
$domDoc = $person->getDomDocument();
$xmlStr = $domDoc->dump_mem(true);
$obj = new PersonEncode();
示例14: executeAjaxCreate
public function executeAjaxCreate(sfWebRequest $request)
{
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');
}
$this->form = new CompanionForm();
$this->form->bind($request->getParameter($this->form->getName()));
if ($this->form->isValid()) {
//----------------------------------------------
$person = new Person();
$names[] = split(" ", $this->form->getValue('name'));
//echo var_dump($names); die();
$person->setFirstName($names[0][0]);
$person->setLastName($names[0][1]);
$person->setDayPhone($this->form->getValue('companion_phone'));
$person->setDayComment($this->form->getValue('companion_phone_comment'));
$person->save();
$comp = $this->form->getObject();
$comp->setPassengerId($this->form->getValue('passenger_id'));
$comp->setName($this->form->getValue('name'));
$comp->setRelationship($this->form->getValue('relationship'));
$comp->setDateOfBirth($this->form->getValue('date_of_birth'));
$comp->setWeight($this->form->getValue('weight'));
$comp->setCompanionPhone($this->form->getValue('companion_phone'));
$comp->setCompanionPhoneComment($this->form->getValue('companion_phone_comment'));
$comp->setPersonId($person->getId());
$comp->save();
//----------------------------------------------
//$companion = $this->form->save();
$id = $comp->getId();
$name = addslashes($comp->getName());
$rel = addslashes($comp->getRelationship());
return $this->renderText("<script type=\"text/javascript\">appendCompanion({$id},'{$name}','{$rel}')</script>");
} else {
$this->setTemplate('ajaxNew');
$this->el_id = $request->getParameter('el_id');
}
}
示例15: testSetAndGetFirstName
public function testSetAndGetFirstName()
{
$this->person->setFirstName('Benjamin');
$this->assertEquals('Benjamin', $this->person->getFirstName());
}