Profile.php

Summary
Profile.php
ProfileTable Definition for profile
ProfileSuperclass representing the table definition for user Profiles and containing interfaces to interact with them.
schemaDefReturns the table schema definition that represents how the table is set up in the database.
__sleepMagic function called at serialize() time.
getByEmailLooks up a profile by the email associated with it.
getUserReturns the user associated with this profile.
getGroupReturns the group associated with this profile.
isGroupReturns true/false whether this profile is associated with a group.
isPersonReturns true/false whether this profile is associated with an individual user (as opposed to a group).
isLocalReturns true/false whether this profile represents a local user.
hasPasswordReturns false if the user has no password (which will always be the case for remote users).
getObjectTypeReturns which ActivityObject represents the user represented by this profile.
getAvatarReturns the avatar associated with this profile.
setOriginalA poorly-named function which sets the avatar associated with this profile.
getBestNameGets either the full name (if filled) or the nickname.
getStreamNameTakes the currently scoped profile into account to give a name to list in notice streams.
getFancyNameGets the full name (if filled) with acct URI, URL, or URI as a parenthetical (in that order, for each not found).
getCurrentNoticeGet the most recent notice posted by this user, if any.
getTagSubscriptionsReturns a Profile_list object containing all the tags this profile has subscribed to.
joinGroupAdds this profile to a user group $group, or, if it has an approval requirement, add it to the approvals queue for the group.
leaveGroupLeave a user group $group that this profile is a member of.
avatarUrlReturns the URL of the avatar associated with this profile, or the URL of of the default avatar if one is not set.
getSubscribedReturns an array of profile objects containing the profiles that this profile subscribes to.
getSubscribersReturns an array of profile objects containing the subscribers to this profile.
getTaggedSubscribersReturns a profile object containing subscribers associated with this profile containing a certain tag $tag.
getTaggedSubscriptionsReturns a profile object containing subscriptions associated with this profile containing a certain tag $tag.
getRequestsReturns an profile containing pending subscribers, who have not yet been approved.
subscriptionCountReturns the number of subscriptions that are associated with this profile.
subscriberCountReturns the number of subscribers that are associated with this profile.
isSubscribedReturns true/false whether this profile is subscribed to profile $other.
readableByReturns true/false whether this profile’s stream is public.
requiresSubscriptionApprovalReturns whether the profile $other requires approval to subscribe to this user
hasPendingSubscriptionReturns true/false if a pending subscription request is outstanding for profile $other.
mutuallySubscribedReturns true/false whether the current profile and the profile $other both subscribe to one another.
noticeCountReturns the number of notices associated with being posted by this profile.
blowSubscriberCountRefresh the subscribers count in the cache for this profile.
blowSucriptionCountRefresh the subscriptions count in the cache for this profile.
blowNoticeCountRefresh the notice count in the cache for this profile.
maxBioReturns the current maximum bio length according to the site settings.
bioTooLongReturns whether a proposed profile bio $bio is too long according to site settings
updateA slightly misleadingly-named function that changes the profile’s nickname in the database when it’s been changed in the backend (ie, user settings)
getRelSelfReturns an associative array with simple profile hints
getRelMesReturns all the known rel=”me”, used for the IndieWeb audience
deleteDeletes a profile and all of the associated notices, subs, tages, etc.
_deleteNoticesHelper function to delete all of the notices associated with this profile.
_deleteSubscriptionsHelper function to delete all of the subscriptions associated with this profile.
_deleteTagsHelper function to delete all the tags associated with a profile.
_deleteBlocksHelper function to delete all the blocks associated with a profile.
_deleteAttentionsHelper function to delete all of the notifications associated with a profile.
getLocationReturns the location associated with a profile.
shareLocationReturns whether the location should be shared according to user and site settings, in the current context.
hasRoleReturns true/false whether the user represented by this profile has the role $name
revokeRoleRemove the user right $name from the user associated with this profile.
isSandboxedReturns true/false whether this user is Sandboxed.
isSilencedReturns true/false whether this user is Silenced (banned).
sandboxSandbox the user represented by this profile.
unsandboxRemove sandboxing from the user represented by this profile.
silenceBan the user represented by this profile.
silenceAsAn interface to silence() that does rights check first
unsilenceRemove a ban from the user represented by this profile.
unsilenceAsAn interface to unsilence() that does rights check first.
currentReturns the current profile as an object, because we have a fetish for returning mixed types.
getProfileReturns this profile object.
sameAsTest whether the given profile is the same as the current class, for testing identities.
shortenLinksThis will perform shortenLinks with the connected User object.
isPrivateStreamReturns true/false whether the user’s stream is set to private.
delPrefDelete an extended preference of the profile.
getPrefRetrieve an extended preference of the profile.
getConfigPrefThe same as getPref but will fall back to common_config value for the same namespace/topic.
setPrefSet an extended preference of the user.
getConnectedAppsReturns an array containing representations of the OAuth apps associated with the user represented by this profile.
getGpgPubKeyReturns the GPG public key associated with the profile, if one exists.
getXmppReturns the XMPP account associated with the profile, if one exists.
getToxIdReturns the TOX ID set for the profile, if one exists.
getMatrixReturns the Matrix ID set for the profile, if one exists.
getDonateUrlReturns the donation URL set for the profile, if one exists

Profile

Table Definition for profile

postActiv

the micro-blogging software

Copyright

Copyright © 2016-2017, Maiyannah Bishop

Derived from code copyright various sources

  • GNU Social © 2013-2016, Free Software Foundation, Inc
  • StatusNet © 2008-2012, StatusNet, Inc

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program.  If not, see http://www.gnu.org/licenses/.

https://www.gnu.org/licenses/agpl.html

About

Superclass containing the database representation of user profiles and the associated interfaces - with is a great many interfaces since user profiles are our largest single data store.

PHP version

Tested with PHP 7

File Authors

Web

Profile

Superclass representing the table definition for user Profiles and containing interfaces to interact with them.

Properties

  • __table = ‘profile’ - table name
  • id - int(4) primary_key not_null
  • nickname - varchar(64) multiple_key not_null
  • fullname - text()
  • profileurl - text()
  • homepage - text()
  • bio - text() multiple_key
  • matrix - text()
  • donateurl - text()
  • toxid - text()
  • xmpp - text()
  • gpgpubkey - text()
  • location - text()
  • lat - decimal(10,7)
  • lon - decimal(10,7)
  • location_id - int(4)
  • location_ns - int(4)
  • created - datetime() not_null
  • modified - timestamp() not_null default_CURRENT_TIMESTAMP
Summary
schemaDefReturns the table schema definition that represents how the table is set up in the database.
__sleepMagic function called at serialize() time.
getByEmailLooks up a profile by the email associated with it.
getUserReturns the user associated with this profile.
getGroupReturns the group associated with this profile.
isGroupReturns true/false whether this profile is associated with a group.
isPersonReturns true/false whether this profile is associated with an individual user (as opposed to a group).
isLocalReturns true/false whether this profile represents a local user.
hasPasswordReturns false if the user has no password (which will always be the case for remote users).
getObjectTypeReturns which ActivityObject represents the user represented by this profile.
getAvatarReturns the avatar associated with this profile.
setOriginalA poorly-named function which sets the avatar associated with this profile.
getBestNameGets either the full name (if filled) or the nickname.
getStreamNameTakes the currently scoped profile into account to give a name to list in notice streams.
getFancyNameGets the full name (if filled) with acct URI, URL, or URI as a parenthetical (in that order, for each not found).
getCurrentNoticeGet the most recent notice posted by this user, if any.
getTagSubscriptionsReturns a Profile_list object containing all the tags this profile has subscribed to.
joinGroupAdds this profile to a user group $group, or, if it has an approval requirement, add it to the approvals queue for the group.
leaveGroupLeave a user group $group that this profile is a member of.
avatarUrlReturns the URL of the avatar associated with this profile, or the URL of of the default avatar if one is not set.
getSubscribedReturns an array of profile objects containing the profiles that this profile subscribes to.
getSubscribersReturns an array of profile objects containing the subscribers to this profile.
getTaggedSubscribersReturns a profile object containing subscribers associated with this profile containing a certain tag $tag.
getTaggedSubscriptionsReturns a profile object containing subscriptions associated with this profile containing a certain tag $tag.
getRequestsReturns an profile containing pending subscribers, who have not yet been approved.
subscriptionCountReturns the number of subscriptions that are associated with this profile.
subscriberCountReturns the number of subscribers that are associated with this profile.
isSubscribedReturns true/false whether this profile is subscribed to profile $other.
readableByReturns true/false whether this profile’s stream is public.
requiresSubscriptionApprovalReturns whether the profile $other requires approval to subscribe to this user
hasPendingSubscriptionReturns true/false if a pending subscription request is outstanding for profile $other.
mutuallySubscribedReturns true/false whether the current profile and the profile $other both subscribe to one another.
noticeCountReturns the number of notices associated with being posted by this profile.
blowSubscriberCountRefresh the subscribers count in the cache for this profile.
blowSucriptionCountRefresh the subscriptions count in the cache for this profile.
blowNoticeCountRefresh the notice count in the cache for this profile.
maxBioReturns the current maximum bio length according to the site settings.
bioTooLongReturns whether a proposed profile bio $bio is too long according to site settings
updateA slightly misleadingly-named function that changes the profile’s nickname in the database when it’s been changed in the backend (ie, user settings)
getRelSelfReturns an associative array with simple profile hints
getRelMesReturns all the known rel=”me”, used for the IndieWeb audience
deleteDeletes a profile and all of the associated notices, subs, tages, etc.
_deleteNoticesHelper function to delete all of the notices associated with this profile.
_deleteSubscriptionsHelper function to delete all of the subscriptions associated with this profile.
_deleteTagsHelper function to delete all the tags associated with a profile.
_deleteBlocksHelper function to delete all the blocks associated with a profile.
_deleteAttentionsHelper function to delete all of the notifications associated with a profile.
getLocationReturns the location associated with a profile.
shareLocationReturns whether the location should be shared according to user and site settings, in the current context.
hasRoleReturns true/false whether the user represented by this profile has the role $name
revokeRoleRemove the user right $name from the user associated with this profile.
isSandboxedReturns true/false whether this user is Sandboxed.
isSilencedReturns true/false whether this user is Silenced (banned).
sandboxSandbox the user represented by this profile.
unsandboxRemove sandboxing from the user represented by this profile.
silenceBan the user represented by this profile.
silenceAsAn interface to silence() that does rights check first
unsilenceRemove a ban from the user represented by this profile.
unsilenceAsAn interface to unsilence() that does rights check first.
currentReturns the current profile as an object, because we have a fetish for returning mixed types.
getProfileReturns this profile object.
sameAsTest whether the given profile is the same as the current class, for testing identities.
shortenLinksThis will perform shortenLinks with the connected User object.
isPrivateStreamReturns true/false whether the user’s stream is set to private.
delPrefDelete an extended preference of the profile.
getPrefRetrieve an extended preference of the profile.
getConfigPrefThe same as getPref but will fall back to common_config value for the same namespace/topic.
setPrefSet an extended preference of the user.
getConnectedAppsReturns an array containing representations of the OAuth apps associated with the user represented by this profile.
getGpgPubKeyReturns the GPG public key associated with the profile, if one exists.
getXmppReturns the XMPP account associated with the profile, if one exists.
getToxIdReturns the TOX ID set for the profile, if one exists.
getMatrixReturns the Matrix ID set for the profile, if one exists.
getDonateUrlReturns the donation URL set for the profile, if one exists

schemaDef

public static function schemaDef()

Returns the table schema definition that represents how the table is set up in the database.

__sleep

function __sleep()

Magic function called at serialize() time.

We use this to drop a couple process-specific references from DB_DataObject which can cause trouble in future processes.

@return array of variable names to include in serialization.

getByEmail

public static function getByEmail($email)

Looks up a profile by the email associated with it.

getUser

public function getUser()

Returns the user associated with this profile.

getGroup

public function getGroup()

Returns the group associated with this profile.

isGroup

public function isGroup()

Returns true/false whether this profile is associated with a group.

isPerson

public function isPerson()

Returns true/false whether this profile is associated with an individual user (as opposed to a group).

isLocal

public function isLocal()

Returns true/false whether this profile represents a local user.

hasPassword

public function hasPassword()

Returns false if the user has no password (which will always be the case for remote users).  This can be the case for OpenID logins or other mechanisms which don’t store a password hash.

getObjectType

public function getObjectType()

Returns which ActivityObject represents the user represented by this profile.

getAvatar

public function getAvatar($width,  
$height = null)

Returns the avatar associated with this profile.

setOriginal

public function setOriginal($filename)

A poorly-named function which sets the avatar associated with this profile.

getBestName

function getBestName()

Gets either the full name (if filled) or the nickname.

Returns

  • string

getStreamName

function getStreamName()

Takes the currently scoped profile into account to give a name to list in notice streams.  Preferences may differ between profiles.

getFancyName

function getFancyName()

Gets the full name (if filled) with acct URI, URL, or URI as a parenthetical (in that order, for each not found).  If no full name is found only the second part is returned, without ()s.

Returns

  • string

getCurrentNotice

function getCurrentNotice(Profile $scoped = null)

Get the most recent notice posted by this user, if any.

Returns

  • mixed Notice or null

getTagSubscriptions

function getTagSubscriptions($offset = 0,
$limit = null,
$since_id = 0,
$max_id = 0)

Returns a Profile_list object containing all the tags this profile has subscribed to.

joinGroup

function joinGroup(User_group $group)

Adds this profile to a user group $group, or, if it has an approval requirement, add it to the approvals queue for the group.

Returns

  • Group_member on success
  • Group_join_queue if pending approval
  • null on some cancels?

leaveGroup

function leaveGroup(User_group $group)

Leave a user group $group that this profile is a member of.

avatarUrl

function avatarUrl($size = AVATAR_PROFILE_SIZE)

Returns the URL of the avatar associated with this profile, or the URL of of the default avatar if one is not set.

getSubscribed

function getSubscribed($offset = 0,
$limit = null)

Returns an array of profile objects containing the profiles that this profile subscribes to.

getSubscribers

function getSubscribers($offset = 0,
$limit = null)

Returns an array of profile objects containing the subscribers to this profile.

getTaggedSubscribers

function getTaggedSubscribers($tag,  
$offset = 0,
$limit = null)

Returns a profile object containing subscribers associated with this profile containing a certain tag $tag.

getTaggedSubscriptions

function getTaggedSubscriptions($tag,  
$offset = 0,
$limit = null)

Returns a profile object containing subscriptions associated with this profile containing a certain tag $tag.

getRequests

function getRequests($offset = 0,
$limit = null)

Returns an profile containing pending subscribers, who have not yet been approved.

FIXME: mysql only

Parameters

  • int $offset
  • int $limit

subscriptionCount

function subscriptionCount()

Returns the number of subscriptions that are associated with this profile.  This will hit the cache if it exists.

subscriberCount

function subscriberCount()

Returns the number of subscribers that are associated with this profile.  This will hit the cache if it exists.

isSubscribed

function isSubscribed(Profile $other)

Returns true/false whether this profile is subscribed to profile $other.

readableBy

function readableBy(Profile $other = null)

Returns true/false whether this profile’s stream is public.  If you specify a profile $other, it will return true/false whether the user represented by that profile can view the profile, if it is private.

requiresSubscriptionApproval

function requiresSubscriptionApproval(Profile $other = null)

Returns whether the profile $other requires approval to subscribe to this user

hasPendingSubscription

function hasPendingSubscription(Profile $other)

Returns true/false if a pending subscription request is outstanding for profile $other.

mutuallySubscribed

function mutuallySubscribed(Profile $other)

Returns true/false whether the current profile and the profile $other both subscribe to one another.

noticeCount

function noticeCount()

Returns the number of notices associated with being posted by this profile.  It will not include anything other than posts (ie not shares/ events/etc)

blowSubscriberCount

function blowSubscriberCount()

Refresh the subscribers count in the cache for this profile.

blowSucriptionCount

Refresh the subscriptions count in the cache for this profile.

blowNoticeCount

function blowNoticeCount()

Refresh the notice count in the cache for this profile.

maxBio

static function maxBio()

Returns the current maximum bio length according to the site settings.

bioTooLong

static function bioTooLong($bio)

Returns whether a proposed profile bio $bio is too long according to site settings

update

function update($dataObject = false)

A slightly misleadingly-named function that changes the profile’s nickname in the database when it’s been changed in the backend (ie, user settings)

getRelSelf

public function getRelSelf()

Returns an associative array with simple profile hints

getRelMes

public function getRelMes()

Returns all the known rel=”me”, used for the IndieWeb audience

delete

function delete($useWhere = false)

Deletes a profile and all of the associated notices, subs, tages, etc.

_deleteNotices

function _deleteNotices()

Helper function to delete all of the notices associated with this profile.

_deleteSubscriptions

function _deleteSubscriptions()

Helper function to delete all of the subscriptions associated with this profile.

_deleteTags

function _deleteTags()

Helper function to delete all the tags associated with a profile.

_deleteBlocks

function _deleteBlocks()

Helper function to delete all the blocks associated with a profile.

_deleteAttentions

function _deleteAttentions()

Helper function to delete all of the notifications associated with a profile.

getLocation

public function getLocation()

Returns the location associated with a profile.

shareLocation

public function shareLocation()

Returns whether the location should be shared according to user and site settings, in the current context.

hasRole

function hasRole($name)

Returns true/false whether the user represented by this profile has the role $name

revokeRole

function revokeRole($name)

Remove the user right $name from the user associated with this profile.

isSandboxed

function isSandboxed()

Returns true/false whether this user is Sandboxed.

isSilenced

function isSilenced()

Returns true/false whether this user is Silenced (banned).

sandbox

function sandbox()

Sandbox the user represented by this profile.

unsandbox

function unsandbox()

Remove sandboxing from the user represented by this profile.

silence

function silence()

Ban the user represented by this profile.

silenceAs

function silenceAs(Profile $actor)

An interface to silence() that does rights check first

Parameters

  • actor - profile of the user we’re checking rights for.

unsilence

function unsilence()

Remove a ban from the user represented by this profile.

unsilenceAs

function unsilenceAs(Profile $actor)

An interface to unsilence() that does rights check first.

Parameters

  • actor - profile of the user we’re checking rights for.

current

static function current()

Returns the current profile as an object, because we have a fetish for returning mixed types.

getProfile

public function getProfile()

Returns this profile object.  Why something would want to call something like this, who knows.  Stop returning mixed types!

sameAs

public function sameAs(Profile $other = null)

Test whether the given profile is the same as the current class, for testing identities.

Parameters

  • Profile $other The other profile, usually from Action’s $this->scoped

Returns

  • boolean

shortenLinks

public function shortenLinks($text,  
$always = false)

This will perform shortenLinks with the connected User object.

Won’t work on remote profiles or groups, so expect a NoSuchUserException if you don’t know it’s a local User.

Parameters

  • string $text - String to shorten
  • boolean $always - Disrespect minimum length etc.

Returns

  • string link-shortened $text

isPrivateStream

public function isPrivateStream()

Returns true/false whether the user’s stream is set to private.

delPref

public function delPref($namespace,
$topic)

Delete an extended preference of the profile.

getPref

public function getPref($namespace,  
$topic,  
$default = null)

Retrieve an extended preference of the profile.

If you want an exception to be thrown on an error, call Profile_prefs::getData directly.

getConfigPref

public function getConfigPref($namespace,
$topic)

The same as getPref but will fall back to common_config value for the same namespace/topic.

setPref

public function setPref($namespace,
$topic,
$data)

Set an extended preference of the user.

getConnectedApps

public function getConnectedApps($offset = 0,
$limit = null)

Returns an array containing representations of the OAuth apps associated with the user represented by this profile.

getGpgPubKey

public function getGpgPubKey()

Returns the GPG public key associated with the profile, if one exists.

getXmpp

public function getXmpp()

Returns the XMPP account associated with the profile, if one exists.

getToxId

public function getToxId()

Returns the TOX ID set for the profile, if one exists.

getMatrix

public function getMatrix()

Returns the Matrix ID set for the profile, if one exists.

getDonateUrl

public function getDonateUrl()

Returns the donation URL set for the profile, if one exists

public static function schemaDef()
Returns the table schema definition that represents how the table is set up in the database.
function __sleep()
Magic function called at serialize() time.
public static function getByEmail($email)
Looks up a profile by the email associated with it.
public function getUser()
Returns the user associated with this profile.
public function getGroup()
Returns the group associated with this profile.
public function isGroup()
Returns true/false whether this profile is associated with a group.
public function isPerson()
Returns true/false whether this profile is associated with an individual user (as opposed to a group).
public function isLocal()
Returns true/false whether this profile represents a local user.
public function hasPassword()
Returns false if the user has no password (which will always be the case for remote users).
public function getObjectType()
Returns which ActivityObject represents the user represented by this profile.
public function getAvatar($width,  
$height = null)
Returns the avatar associated with this profile.
public function setOriginal($filename)
A poorly-named function which sets the avatar associated with this profile.
function getBestName()
Gets either the full name (if filled) or the nickname.
function getStreamName()
Takes the currently scoped profile into account to give a name to list in notice streams.
function getFancyName()
Gets the full name (if filled) with acct URI, URL, or URI as a parenthetical (in that order, for each not found).
function getCurrentNotice(Profile $scoped = null)
Get the most recent notice posted by this user, if any.
function getTagSubscriptions($offset = 0,
$limit = null,
$since_id = 0,
$max_id = 0)
Returns a Profile_list object containing all the tags this profile has subscribed to.
function joinGroup(User_group $group)
Adds this profile to a user group $group, or, if it has an approval requirement, add it to the approvals queue for the group.
function leaveGroup(User_group $group)
Leave a user group $group that this profile is a member of.
function avatarUrl($size = AVATAR_PROFILE_SIZE)
Returns the URL of the avatar associated with this profile, or the URL of of the default avatar if one is not set.
function getSubscribed($offset = 0,
$limit = null)
Returns an array of profile objects containing the profiles that this profile subscribes to.
function getSubscribers($offset = 0,
$limit = null)
Returns an array of profile objects containing the subscribers to this profile.
function getTaggedSubscribers($tag,  
$offset = 0,
$limit = null)
Returns a profile object containing subscribers associated with this profile containing a certain tag $tag.
function getTaggedSubscriptions($tag,  
$offset = 0,
$limit = null)
Returns a profile object containing subscriptions associated with this profile containing a certain tag $tag.
function getRequests($offset = 0,
$limit = null)
Returns an profile containing pending subscribers, who have not yet been approved.
function subscriptionCount()
Returns the number of subscriptions that are associated with this profile.
function subscriberCount()
Returns the number of subscribers that are associated with this profile.
function isSubscribed(Profile $other)
Returns true/false whether this profile is subscribed to profile $other.
function readableBy(Profile $other = null)
Returns true/false whether this profile’s stream is public.
function requiresSubscriptionApproval(Profile $other = null)
Returns whether the profile $other requires approval to subscribe to this user
function hasPendingSubscription(Profile $other)
Returns true/false if a pending subscription request is outstanding for profile $other.
function mutuallySubscribed(Profile $other)
Returns true/false whether the current profile and the profile $other both subscribe to one another.
function noticeCount()
Returns the number of notices associated with being posted by this profile.
function blowSubscriberCount()
Refresh the subscribers count in the cache for this profile.
function blowNoticeCount()
Refresh the notice count in the cache for this profile.
static function maxBio()
Returns the current maximum bio length according to the site settings.
static function bioTooLong($bio)
Returns whether a proposed profile bio $bio is too long according to site settings
function update($dataObject = false)
A slightly misleadingly-named function that changes the profile’s nickname in the database when it’s been changed in the backend (ie, user settings)
public function getRelSelf()
Returns an associative array with simple profile hints
public function getRelMes()
Returns all the known rel=”me”, used for the IndieWeb audience
function delete($useWhere = false)
Deletes a profile and all of the associated notices, subs, tages, etc.
function _deleteNotices()
Helper function to delete all of the notices associated with this profile.
function _deleteSubscriptions()
Helper function to delete all of the subscriptions associated with this profile.
function _deleteTags()
Helper function to delete all the tags associated with a profile.
function _deleteBlocks()
Helper function to delete all the blocks associated with a profile.
function _deleteAttentions()
Helper function to delete all of the notifications associated with a profile.
public function getLocation()
Returns the location associated with a profile.
public function shareLocation()
Returns whether the location should be shared according to user and site settings, in the current context.
function hasRole($name)
Returns true/false whether the user represented by this profile has the role $name
function revokeRole($name)
Remove the user right $name from the user associated with this profile.
function isSandboxed()
Returns true/false whether this user is Sandboxed.
function isSilenced()
Returns true/false whether this user is Silenced (banned).
function sandbox()
Sandbox the user represented by this profile.
function unsandbox()
Remove sandboxing from the user represented by this profile.
function silence()
Ban the user represented by this profile.
function silenceAs(Profile $actor)
An interface to silence() that does rights check first
function unsilence()
Remove a ban from the user represented by this profile.
function unsilenceAs(Profile $actor)
An interface to unsilence() that does rights check first.
static function current()
Returns the current profile as an object, because we have a fetish for returning mixed types.
public function getProfile()
Returns this profile object.
public function sameAs(Profile $other = null)
Test whether the given profile is the same as the current class, for testing identities.
public function shortenLinks($text,  
$always = false)
This will perform shortenLinks with the connected User object.
public function isPrivateStream()
Returns true/false whether the user’s stream is set to private.
public function delPref($namespace,
$topic)
Delete an extended preference of the profile.
public function getPref($namespace,  
$topic,  
$default = null)
Retrieve an extended preference of the profile.
public function getConfigPref($namespace,
$topic)
The same as getPref but will fall back to common_config value for the same namespace/topic.
public function setPref($namespace,
$topic,
$data)
Set an extended preference of the user.
public function getConnectedApps($offset = 0,
$limit = null)
Returns an array containing representations of the OAuth apps associated with the user represented by this profile.
public function getGpgPubKey()
Returns the GPG public key associated with the profile, if one exists.
public function getXmpp()
Returns the XMPP account associated with the profile, if one exists.
public function getToxId()
Returns the TOX ID set for the profile, if one exists.
public function getMatrix()
Returns the Matrix ID set for the profile, if one exists.
public function getDonateUrl()
Returns the donation URL set for the profile, if one exists