本文整理汇总了PHP中Agent::getDisplayName方法的典型用法代码示例。如果您正苦于以下问题:PHP Agent::getDisplayName方法的具体用法?PHP Agent::getDisplayName怎么用?PHP Agent::getDisplayName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Agent
的用法示例。
在下文中一共展示了Agent::getDisplayName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAgentUID
/**
* Answer a UID for an agent
*
* @param Agent $agent
* @return string
*/
protected function getAgentUID(Agent $agent)
{
if ($properties = $agent->getPropertiesByType(new HarmoniType("GroupProperties", "edu.middlebury", "CAS Properties"))) {
return strtolower($properties->getProperty('Id'));
} else {
if ($properties = $agent->getPropertiesByType(new HarmoniType("Authentication", "edu.middlebury.harmoni", "Visitors"))) {
return strtolower($properties->getProperty('identifier'));
} else {
return strtolower($agent->getDisplayName());
}
}
}
示例2: __construct
/**
* Constructor
*
* @param object Agent $agent
* @return void
* @access public
* @since 11/27/07
*/
public function __construct(Agent $agent)
{
$this->id = $agent->getId();
$this->name = $agent->getDisplayName();
try {
$propertiesIterator = $agent->getProperties();
while ($propertiesIterator->hasNext()) {
$properties = $propertiesIterator->next();
try {
if ($properties->getProperty('email')) {
$this->email = $properties->getProperty('email');
break;
}
} catch (Exception $e) {
}
}
} catch (Exception $e) {
}
}
示例3: getAgentEmail
/**
* Answer the email address of an agent
*
* @param Agent $agent
* @return string
* @access protected
* @since 2/19/09
*/
protected function getAgentEmail(Agent $agent)
{
$properties = $agent->getProperties();
$email = null;
while ($properties->hasNext()) {
$email = $properties->next()->getProperty("email");
if (preg_match('/^[^\\s@]+@[^\\s@]+$/', $email)) {
return $email;
}
}
throw new OperationFailedException("No email found for agent, '" . $agent->getDisplayName() . "'.");
}