本文整理汇总了PHP中Authentication::getLoggedUser方法的典型用法代码示例。如果您正苦于以下问题:PHP Authentication::getLoggedUser方法的具体用法?PHP Authentication::getLoggedUser怎么用?PHP Authentication::getLoggedUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Authentication
的用法示例。
在下文中一共展示了Authentication::getLoggedUser方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
function render()
{
$estimate = $this->object->tracking()->getEstimate();
if ($estimate instanceof Estimate) {
$estimate_value = $estimate->getValue();
$estimate_autogenerated = $this->object->tracking()->isEstimateAutogenerated();
} else {
$estimate_value = 0;
$estimate_autogenerated = false;
}
// if
$settings = array('value' => $estimate_value, 'summed_time' => $this->object->tracking()->sumTime(Authentication::getLoggedUser()), 'estimate_autogenerated' => $estimate_autogenerated, 'short_format' => true, 'can_change' => $this->object->tracking()->canEstimate(Authentication::getLoggedUser()), 'estimates_url' => $this->object->tracking()->getEstimatesUrl(), 'set_estimate_url' => $this->object->tracking()->getSetEstimateUrl(), 'object_id' => $this->object->getId());
return '(function (field, object, client_interface) {
App.Inspector.Properties.MilestoneEstimation.apply(field, [object, ' . JSON::encode($settings) . ']);
})';
}
示例2: describeForApi
/**
* Return array or property => value pairs that describes this object
*
* @param IUser $user
* @param boolean $detailed
* @return array
*/
function describeForApi(IUser $user, $detailed = false)
{
$mil_t = new Milestone($this->getId());
$result = $mil_t->describeForApi($user, $detailed, $for_interface);
// In this exact order, it's important!
$result = array_merge(parent::describeForApi($user, $detailed, $for_interface), $result);
$result['id'] = $this->getId();
if ($detailed) {
$result['custom_percent_complete'] = $this->getPercentsDone(false);
$result['remaining_time'] = $this->getRemainingTime();
$result['summed_time'] = $this->tracking()->sumTime(Authentication::getLoggedUser());
}
return $result;
}