本文整理汇总了PHP中Idno\Entities\User::getURL方法的典型用法代码示例。如果您正苦于以下问题:PHP User::getURL方法的具体用法?PHP User::getURL怎么用?PHP User::getURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Idno\Entities\User
的用法示例。
在下文中一共展示了User::getURL方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addFollowing
/**
* Given a user entity (or a UUID), marks them as being followed by this user.
* Remember to save this user entity.
*
* @param \Idno\Entities\User|string $user
* @return bool
*/
function addFollowing($user)
{
if ($user instanceof \Idno\Entities\User) {
$users = $this->getFollowingUUIDs();
if (!in_array($user->getUUID(), $users, true)) {
$users[$user->getUUID()] = array('name' => $user->getTitle(), 'icon' => $user->getIcon(), 'url' => $user->getURL());
$this->following = $users;
// Create/modify ACL for following user
$acl = \Idno\Entities\AccessGroup::getOne(array('owner' => $this->getUUID(), 'access_group_type' => 'FOLLOWING'));
if (empty($acl)) {
$acl = new \Idno\Entities\AccessGroup();
$acl->title = "People I follow...";
$acl->access_group_type = 'FOLLOWING';
}
$acl->addMember($user->getUUID());
$acl->save();
\Idno\Core\Idno::site()->triggerEvent('follow', array('user' => $this, 'following' => $user));
return true;
}
}
return false;
}