本文整理汇总了PHP中Agent::setprefix方法的典型用法代码示例。如果您正苦于以下问题:PHP Agent::setprefix方法的具体用法?PHP Agent::setprefix怎么用?PHP Agent::setprefix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Agent
的用法示例。
在下文中一共展示了Agent::setprefix方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAndChangeAgentFromRequest
/**
* Get agent fields from the request, and construct an
* agent object using those values. The agent is loaded from the
* database and then has values changed from the request if a
* value is provided for agentid, otherwise a new agent is
* created. This method does not save the changes to the
* database, invoke save on the returned object to accomplish that.
*
* @return an agent object in state dirty, or null if an error
* occurred in obtaining data.
*/
public function getAndChangeAgentFromRequest($agentid = '')
{
$result = new Agent();
$agentid = preg_replace("[^0-9]", '', $agentid);
if (strlen($agentid) > 0) {
$result->load($agentid);
}
$result->setfamilyname($_REQUEST["familyname"]);
$result->setfirstname($_REQUEST["firstname"]);
$result->setmiddlename($_REQUEST["middlename"]);
$result->setprefix($_REQUEST["prefix"]);
$result->setsuffix($_REQUEST["suffix"]);
$result->setnamestring($_REQUEST["namestring"]);
$result->settype($_REQUEST["type"]);
$result->setyearofbirth($_REQUEST["yearofbirth"]);
$result->setyearofbirthmodifier($_REQUEST["yearofbirthmodifier"]);
$result->setyearofdeath($_REQUEST["yearofdeath"]);
$result->setyearofdeathmodifier($_REQUEST["yearofdeathmodifier"]);
$result->setstartyearactive($_REQUEST["startyearactive"]);
$result->setendyearactive($_REQUEST["endyearactive"]);
$result->setnotes($_REQUEST["notes"]);
$result->setrating($_REQUEST["rating"]);
$result->setguid($_REQUEST["guid"]);
$result->setbiography($_REQUEST["biography"]);
$result->settaxonomicgroups($_REQUEST["taxonomicgroups"]);
$result->setcollectionsat($_REQUEST["collectionsat"]);
$result->setcurated($_REQUEST["curated"]);
$result->setmbox_sha1sum($_REQUEST["mbox_sha1sum"]);
$result->setpreferredrecbyid($_REQUEST["preferredrecbyid"]);
$result->setnototherwisespecified($_REQUEST["nototherwisespecified"]);
$result->setliving($_REQUEST["living"]);
return $result;
}