本文整理汇总了PHP中Person::getGender方法的典型用法代码示例。如果您正苦于以下问题:PHP Person::getGender方法的具体用法?PHP Person::getGender怎么用?PHP Person::getGender使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Person
的用法示例。
在下文中一共展示了Person::getGender方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSetValidGender
public function testSetValidGender()
{
$max = new Person('Max', 'Mustermann', Person::GENDER_MALE);
$max->setGender(Person::GENDER_MALE);
$this->assertEquals(Person::GENDER_MALE, $max->getGender());
$max->setGender(Person::GENDER_FEMALE);
$this->assertEquals(Person::GENDER_FEMALE, $max->getGender());
}
示例2: Main
function Main()
{
switch ($this->formArray["ownerType"]) {
case "Person":
$this->tpl->set_block("rptsTemplate", "CompanyDetails", "CompanyDetailsBlock");
$this->tpl->set_var("CompanyDetailsBlock", "");
$person = new Person();
$person->selectRecord($this->formArray["id"]);
$this->tpl->set_var("id", $person->getPersonID());
$this->tpl->set_var("lastName", $person->getLastName());
$this->tpl->set_var("firstName", $person->getFirstName());
$this->tpl->set_var("middleName", $person->getMiddleName());
$this->tpl->set_var("gender", $person->getGender());
$this->tpl->set_var("birthday", $person->getBirthday());
$this->tpl->set_var("maritalStatus", $person->getMaritalStatus());
$this->tpl->set_var("tin", $person->getTin());
$address = $person->addressArray[0];
if (is_a($address, Address)) {
$this->tpl->set_var("fullAddress", $address->getFullAddress());
}
$this->tpl->set_var("telephone", $person->getTelephone());
$this->tpl->set_var("mobileNumber", $person->getMobileNumber());
$this->tpl->set_var("email", $person->getEmail());
break;
case "Company":
$this->tpl->set_block("rptsTemplate", "PersonDetails", "PersonDetailsBlock");
$this->tpl->set_var("PersonDetailsBlock", "");
$company = new Company();
$company->selectRecord($this->formArray["id"]);
$this->tpl->set_var("id", $company->getCompanyID());
$this->tpl->set_var("companyName", $company->getCompanyName());
$this->tpl->set_var("tin", $company->getTin());
$this->tpl->set_var("telephone", $company->getTelephone());
$this->tpl->set_var("fax", $company->getFax());
$address = $company->addressArray[0];
if (is_a($address, Address)) {
$this->tpl->set_var("fullAddress", $address->getFullAddress());
}
$this->tpl->set_var("email", $company->getEmail());
$this->tpl->set_var("website", $company->getWebsite());
break;
default:
exit("No Person/Company selected. <a href='OwnerList.php" . $this->sess->url("") . "'>Click here</a> to go back to the Owner List.");
break;
}
$this->tpl->set_var("ownerType", $this->formArray["ownerType"]);
$this->tpl->set_var("uname", $this->user["uname"]);
$this->tpl->set_var("today", date("F j, Y"));
$this->setPageDetailPerms();
$this->tpl->set_var("Session", $this->sess->url(""));
$this->tpl->parse("templatePage", "rptsTemplate");
$this->tpl->finish("templatePage");
$this->tpl->p("templatePage");
}
示例3: testSetAndGetGender
public function testSetAndGetGender()
{
$this->person->setGender(2);
$this->assertEquals(2, $this->person->getGender());
}
示例4: array
<?php
//echo $form->textField($model, 'name', array('size' => 45, 'maxlength' => 45));
$this->widget('zii.widgets.jui.CJuiAutoComplete', array('model' => $model, 'attribute' => 'name', 'source' => $this->createUrl('author/autoSearchAuthor'), 'options' => array('showAnim' => 'fold')));
?>
<?php
echo $form->error($model, 'name');
?>
</div>
<div class="row">
<?php
echo $form->labelEx($model, 'gender');
?>
<?php
echo $form->dropDownList($model, 'gender', Person::getGender());
?>
<?php
echo $form->error($model, 'gender');
?>
</div>
<div class="row">
<?php
echo $form->labelEx($model, 'realname');
?>
<?php
echo $form->textField($model, 'realname', array('size' => 45, 'maxlength' => 45));
?>
<?php
echo $form->error($model, 'realname');
示例5: 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"]);
//.........这里部分代码省略.........
示例6: Main
function Main()
{
switch ($this->formArray["formAction"]) {
case "edit":
$UserDetails = new SoapObject(NCCBIZ . "UserDetails.php", "urn:Object");
if (!($xmlStr = $UserDetails->getUserDetails($this->formArray["userID"]))) {
$this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
$this->tpl->set_var("TableBlock", "User 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 {
$user = new User();
$user->parseDomDocument($domDoc);
$this->formArray["userID"] = $user->getUserID();
$this->formArray["userType"] = $user->getUserType();
$this->formArray["username"] = $user->getUsername();
$this->formArray["password"] = $user->getPassword();
$this->formArray["personID"] = $user->getPersonID();
$this->formArray["status"] = $user->getStatus();
}
}
$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);
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();
}
}
$this->tpl->set_block("rptsTemplate", "NewUserPassword", "NewUserPasswordBlock");
$this->tpl->set_var("NewUserPasswordBlock", "");
$this->tpl->set_block("rptsTemplate", "OldUserPassword", "OldUserPasswordBlock");
$this->tpl->set_var("oldNewUserRowspan", 5);
//$this->tpl->set_var("oldNewUserRowspan", 3);
$this->tpl->parse("OldUserPasswordBlock", "OldUserPassword", true);
break;
case "save":
/*
if($this->isOldPasswordCorrect()==false){
$this->message = "Error. Cannot Save. Old password incorrect to create new password.";
$this->tpl->set_var("message", $this->message);
$this->tpl->parse("MessageBlock", "Message", true);
$this->tpl->set_block("rptsTemplate", "NewUserPassword", "NewUserPasswordBlock");
$this->tpl->set_var("NewUserPasswordBlock", "");
$this->tpl->set_block("rptsTemplate", "OldUserPassword", "OldUserPasswordBlock");
$this->tpl->set_var("oldNewUserRowspan", 3);
$this->tpl->parse("OldUserPasswordBlock", "OldUserPassword", true);
break;
}
*/
if ($this->formArray["newPassword"] != "" && $this->formArray["newPassword"] != "null") {
$this->formArray["password"] = md5($this->formArray["newPassword"]);
}
if ($this->usernameAlreadyExists() == true) {
$this->message = "Error. Cannot Save. Username already exists.";
$this->tpl->set_var("message", $this->message);
$this->tpl->parse("MessageBlock", "Message", true);
$this->tpl->set_block("rptsTemplate", "NewUserPassword", "NewUserPasswordBlock");
$this->tpl->set_block("rptsTemplate", "OldUserPassword", "OldUserPasswordBlock");
if ($this->formArray["personID"] != "") {
$this->tpl->set_var("NewUserPasswordBlock", "");
$this->tpl->set_var("oldNewUserRowspan", 3);
$this->tpl->parse("OldUserPasswordBlock", "OldUserPassword", true);
} else {
$this->tpl->set_var("oldNewUserRowspan", 2);
$this->tpl->parse("NewUserPasswordBlock", "NewUserPassword", true);
$this->tpl->set_var("OldUserPasswordBlock", "");
//.........这里部分代码省略.........
示例7: testGetGender
/**
* Tests Person->getGender()
*/
public function testGetGender()
{
$this->Person->setGender('FEMALE');
$this->assertEquals('FEMALE', $this->Person->getGender());
}
示例8: updatePerson
/**
* Update one Person in the database
*
* @author Jonathan Sandoval <jonathan_s_pisis@yahoo.com.mx>
* @param Person $Person The Person to update
* @return boolean If was possible to update
*/
static function updatePerson($Person = null)
{
if ($Person === null) {
return false;
}
$tablePerson = DatabaseManager::getNameTable('TABLE_PERSON');
$id = $Person->getId();
$names = $Person->getNames();
$lastname1 = $Person->getLastname1();
$lastname2 = $Person->getLastname2();
$gender = $Person->getGender();
$address = $Person->getAddress();
$phoneNumber = $Person->getPhoneNumber();
$Person->getIdFather() == 0 ? $idFather = 'null' : ($idFather = $Person->getIdFather());
$Person->getIdMother() == 0 ? $idMother = 'null' : ($idMother = $Person->getIdMother());
$idCityAddress = $Person->getIdCityAddress();
if ($idCityAddress === NULL) {
$idCityAddress = 'NULL';
}
$query = "UPDATE {$tablePerson}\n SET names = '{$names}', \n lastname1 = '{$lastname1}', \n lastname2 = '{$lastname2}', \n gender = '{$gender}', \n address = '{$address}', \n phoneNumber = '{$phoneNumber}', \n idFather = {$idFather}, \n idMother = {$idMother}, \n idCityAddress = {$idCityAddress}\n WHERE {$tablePerson}.id = {$id}";
return DatabaseManager::singleAffectedRow($query);
}
示例9: testGetGender
/**
* Tests Person->getGender()
*/
public function testGetGender()
{
$gender = new EnumGender('FEMALE');
$this->Person->setGender('FEMALE');
$this->assertEquals($gender, $this->Person->getGender());
}
示例10: enforceGender
/**
* Only Acceptable values are MALE or FEMALE
*
* @param Person $rawOSPerson
* @see http://code.google.com/apis/opensocial/docs/0.7/reference/opensocial.Enum.Gender.html
*/
private static function enforceGender(Person &$rawOSPerson)
{
$gender = $rawOSPerson->getGender();
if ($gender == 'M' || $gender == 'm') {
$rawOSPerson->setGender('MALE');
} else {
$rawOSPerson->setGender('FEMALE');
}
}
示例11: Main
function Main($referer = "")
{
//if (trim($referer) == "" || !isset($referer))
$referer = "OwnerList.php";
$this->tpl->set_var("referer", $referer);
switch ($this->formArray["formAction"]) {
case "save" || "view" || "viewOnly":
$this->tpl->set_var("referer", $referer);
$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);
$this->formArray["personID"] = $person->getPersonID();
$this->formArray["personName"] = $person->getFullName();
$this->formArray["lastName"] = $person->getLastName();
$this->formArray["firstName"] = $person->getFirstName();
$this->formArray["middleName"] = $person->getMiddleName();
$this->formArray["gender"] = $person->getGender();
$this->formArray["birthday"] = $person->getBirthday();
$this->formArray["maritalStatus"] = $person->getMaritalStatus();
$this->formArray["tin"] = $person->getTin();
$address = $person->addressArray[0];
if (is_a($address, Address)) {
$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();
}
}
if ($this->formArray["formAction"] == "viewOnly") {
$this->tpl->set_block("rptsTemplate", "ViewOnly", "ViewOnlyBlock");
$this->tpl->set_var("ViewOnlyBlock", "");
}
break;
case "cancel":
//header("location: PersonList.php");
exit;
break;
default:
$this->tpl->set_block("rptsTemplate", "ACK", "ACKBlock");
$this->tpl->set_var("ACKBlock", "");
}
//*/
$this->tpl->set_var("Session", $this->sess->url(""));
$this->setForm();
$this->tpl->parse("templatePage", "rptsTemplate");
$this->tpl->finish("templatePage");
$this->tpl->p("templatePage");
}