本文整理汇总了PHP中obj::getGUID方法的典型用法代码示例。如果您正苦于以下问题:PHP obj::getGUID方法的具体用法?PHP obj::getGUID怎么用?PHP obj::getGUID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类obj
的用法示例。
在下文中一共展示了obj::getGUID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: chat_register_addusers_button
/**
* Add title button for adding more people to a chat.
*
* All members of the chat are allowed to add people.
*
* @todo Is it possible to use userpicker through lightbox?
*
* @param obj $entity ElggChat object
*/
function chat_register_addusers_button($entity)
{
if (elgg_is_logged_in()) {
$user = elgg_get_logged_in_user_entity();
if ($user && $entity->isMember()) {
$guid = $entity->getGUID();
elgg_register_menu_item('title', array('name' => 'chat_members', 'href' => "chat/members/{$guid}", 'text' => elgg_echo('chat:members:add'), 'link_class' => 'elgg-button elgg-button-action'));
}
/*
elgg_load_js('lightbox');
elgg_load_css('lightbox');
elgg_load_js('elgg.userpicker');
*/
}
}
示例2: increaseUnreadMessageCount
/**
* Increase the number of unread messages for an user.
*
* @param obj $user
* @return boolean
*/
public function increaseUnreadMessageCount($user)
{
// Increase the number of unread messages under the chat
$options = array('annotation_owner_guids' => $user->getGUID());
$num_unread = $this->getUnreadMessagesCount($options, true);
if ($num_unread) {
// Increase the value of annotation
$num_unread->value = $num_unread->value + 1;
return $num_unread->save();
} else {
// Add new annotation
return $this->annotate('unread_messages', 1, ACCESS_LOGGED_IN, $user->getGUID());
}
}