Overview

Packages

  • ClipIt
    • clipit
      • api
    • urjc
      • backend
  • Elgg
    • Core
      • Access
      • Authentication
      • Cache
      • Caches
      • Core
      • DataMode
        • Site
      • DataModel
        • Annotations
        • Entities
        • Extender
        • File
        • Importable
        • Loggable
        • Notable
        • Object
        • User
      • DataStorage
      • Exception
      • Exceptions
        • Stub
      • FileStore
        • Disk
      • Groups
      • Helpers
      • HMAC
      • Memcache
      • Metadata
      • Navigation
      • ODD
      • Output
      • Plugins
        • Settings
      • Sessions
      • SocialModel
        • Friendable
        • Locatable
      • WebServicesAPI
      • Widgets
      • XML
      • XMLRPC
    • Exceptions
      • Stub
  • None
  • PHP

Classes

  • ElggUser
  • Overview
  • Package
  • Class
  • Tree

Class ElggUser

ElggUser

Representation of a "user" in the system.

ElggData implements Loggable, Iterator, ArrayAccess, Exportable
Extended by ElggEntity implements Notable, Locatable, Importable
Extended by ElggUser implements Friendable
Package: Elgg\Core\DataModel\User
Located at ElggUser.php
Methods summary
protected
# initializeAttributes( )

Initialise the attributes array. This is vital to distinguish between metadata and base parameters.

Initialise the attributes array. This is vital to distinguish between metadata and base parameters.

Place your base parameters here.

Overrides

ElggEntity::initializeAttributes()
public
# __construct( mixed $guid = null )

Construct a new user entity, optionally from a given id value.

Construct a new user entity, optionally from a given id value.

Parameters

$guid
mixed
$guid If an int, load that GUID. If an entity table db row then will load the rest of the data.

Throws

Exception
if there was a problem creating the user.
protected boolean
# load( mixed $guid )

Load the ElggUser data from the database

Load the ElggUser data from the database

Parameters

$guid
mixed
$guid ElggUser GUID or stdClass database row from entity table

Returns

boolean

Overrides

ElggEntity::load()
public boolean
# save( )

Saves this user to the database.

Saves this user to the database.

Returns

boolean

Throws

IOException

Overrides

ElggEntity::save()
public boolean
# delete( )

User specific override of the entity delete method.

User specific override of the entity delete method.

Returns

boolean

Overrides

ElggEntity::delete()
public boolean
# ban( string $reason = "" )

Ban this user.

Ban this user.

Parameters

$reason
string
$reason Optional reason

Returns

boolean
public boolean
# unban( )

Unban this user.

Unban this user.

Returns

boolean
public boolean
# isBanned( )

Is this user banned or not?

Is this user banned or not?

Returns

boolean
public boolean
# isAdmin( )

Is this user admin?

Is this user admin?

Returns

boolean
public boolean
# makeAdmin( )

Make the user an admin

Make the user an admin

Returns

boolean
public boolean
# removeAdmin( )

Remove the admin flag for user

Remove the admin flag for user

Returns

boolean
public array
# getSites( string $subtype = "", integer $limit = 10, integer $offset = 0 )

Get sites that this user is a member of

Get sites that this user is a member of

Parameters

$subtype
string
$subtype Optionally, the subtype of result we want to limit to
$limit
integer
$limit The number of results to return
$offset
integer
$offset Any indexing offset

Returns

array
public boolean
# addToSite( integer $site_guid )

Add this user to a particular site

Add this user to a particular site

Parameters

$site_guid
integer
$site_guid The guid of the site to add it to

Returns

boolean
public boolean
# removeFromSite( integer $site_guid )

Remove this user from a particular site

Remove this user from a particular site

Parameters

$site_guid
integer
$site_guid The guid of the site to remove it from

Returns

boolean
public boolean
# addFriend( integer $friend_guid )

Adds a user as a friend

Adds a user as a friend

Parameters

$friend_guid
integer
$friend_guid The GUID of the user to add

Returns

boolean

Implementation of

Friendable::addFriend()
public boolean
# removeFriend( integer $friend_guid )

Removes a user as a friend

Removes a user as a friend

Parameters

$friend_guid
integer
$friend_guid The GUID of the user to remove

Returns

boolean

Implementation of

Friendable::removeFriend()
public boolean
# isFriend( )

Determines whether or not this user is a friend of the currently logged in user

Determines whether or not this user is a friend of the currently logged in user

Returns

boolean

Implementation of

Friendable::isFriend()
public boolean
# isFriendsWith( integer $user_guid )

Determines whether this user is friends with another user

Determines whether this user is friends with another user

Parameters

$user_guid
integer
$user_guid The GUID of the user to check against

Returns

boolean

Implementation of

Friendable::isFriendsWith()
public boolean
# isFriendOf( integer $user_guid )

Determines whether or not this user is another user's friend

Determines whether or not this user is another user's friend

Parameters

$user_guid
integer
$user_guid The GUID of the user to check against

Returns

boolean

Implementation of

Friendable::isFriendOf()
public array|false
# getFriends( string $subtype = "", integer $limit = 10, integer $offset = 0 )

Gets this user's friends

Gets this user's friends

Parameters

$subtype
string
$subtype Optionally, the user subtype (leave blank for all)
$limit
integer
$limit The number of users to retrieve
$offset
integer
$offset Indexing offset, if any

Returns

array|false
Array of ElggUser, or false, depending on success

Implementation of

Friendable::getFriends()
public array|false
# getFriendsOf( string $subtype = "", integer $limit = 10, integer $offset = 0 )

Gets users who have made this user a friend

Gets users who have made this user a friend

Parameters

$subtype
string
$subtype Optionally, the user subtype (leave blank for all)
$limit
integer
$limit The number of users to retrieve
$offset
integer
$offset Indexing offset, if any

Returns

array|false
Array of ElggUser, or false, depending on success

Implementation of

Friendable::getFriendsOf()
public string
# listFriends( string $subtype = "", integer $limit = 10, array $vars = array() )

Lists the user's friends

Lists the user's friends

Parameters

$subtype
string
$subtype Optionally, the user subtype (leave blank for all)
$limit
integer
$limit The number of users to retrieve
$vars
array
$vars Display variables for the user view

Returns

string
Rendered list of friends

Since

1.8.0
public array|false
# getGroups( string $subtype = "", integer $limit = 10, integer $offset = 0 )

Gets the user's groups

Gets the user's groups

Parameters

$subtype
string
$subtype Optionally, the subtype of user to filter to (leave blank for all)
$limit
integer
$limit The number of groups to retrieve
$offset
integer
$offset Indexing offset, if any

Returns

array|false
Array of ElggGroup, or false, depending on success
public string
# listGroups( string $subtype = "", integer $limit = 10, integer $offset = 0 )

Lists the user's groups

Lists the user's groups

Parameters

$subtype
string
$subtype Optionally, the user subtype (leave blank for all)
$limit
integer
$limit The number of users to retrieve
$offset
integer
$offset Indexing offset, if any

Returns

string
public array|false
# getObjects( string $subtype = "", integer $limit = 10, integer $offset = 0 )

Get an array of ElggObject owned by this user.

Get an array of ElggObject owned by this user.

Parameters

$subtype
string
$subtype The subtype of the objects, if any
$limit
integer
$limit Number of results to return
$offset
integer
$offset Any indexing offset

Returns

array|false

Implementation of

Friendable::getObjects()
public array|false
# getFriendsObjects( string $subtype = "", integer $limit = 10, integer $offset = 0 )

Get an array of ElggObjects owned by this user's friends.

Get an array of ElggObjects owned by this user's friends.

Parameters

$subtype
string
$subtype The subtype of the objects, if any
$limit
integer
$limit Number of results to return
$offset
integer
$offset Any indexing offset

Returns

array|false

Implementation of

Friendable::getFriendsObjects()
public integer
# countObjects( string $subtype = "" )

Counts the number of ElggObjects owned by this user

Counts the number of ElggObjects owned by this user

Parameters

$subtype
string
$subtype The subtypes of the objects, if any

Returns

integer
The number of ElggObjects

Implementation of

Friendable::countObjects()
public array|false
# getCollections( string $subtype = "", integer $limit = 10, integer $offset = 0 )

Get the collections associated with a user.

Get the collections associated with a user.

Parameters

$subtype
string
$subtype Optionally, the subtype of result we want to limit to
$limit
integer
$limit The number of results to return
$offset
integer
$offset Any indexing offset

Returns

array|false
public integer
# getOwnerGUID( )

Get a user's owner GUID

Get a user's owner GUID

Returns it's own GUID if the user is not owned.

Returns

integer

Overrides

ElggEntity::getOwnerGUID()
public array
# getExportableValues( )

Return an array of fields which can be exported.

Return an array of fields which can be exported.

Returns

array

Overrides

ElggEntity::getExportableValues()
public boolean
# __set( string $name, mixed $value )

Need to catch attempts to make a user an admin. Remove for 1.9

Need to catch attempts to make a user an admin. Remove for 1.9

Parameters

$name
string
$name Name
$value
mixed
$value Value

Returns

boolean

Overrides

ElggData::__set()
public boolean
# __get( string $name )

Need to catch attempts to test user for admin. Remove for 1.9

Need to catch attempts to test user for admin. Remove for 1.9

Parameters

$name
string
$name Name

Returns

boolean

Overrides

ElggData::__get()
public boolean
# canComment( integer $user_guid = 0 )

Can a user comment on this user?

Can a user comment on this user?

Parameters

$user_guid
integer
$user_guid User guid (default is logged in user)

Returns

boolean

Since

1.8.0

See

ElggEntity::canComment()

Overrides

ElggEntity::canComment()
Methods inherited from ElggEntity
__clone(), __unset(), addRelationship(), annotate(), canAnnotate(), canEdit(), canEditMetadata(), canWriteToContainer(), countAnnotations(), countComments(), countEntitiesFromRelationship(), deleteAnnotations(), deleteMetadata(), deleteOwnedAnnotations(), deleteOwnedMetadata(), deleteRelationships(), disable(), disableAnnotations(), disableMetadata(), enable(), enableAnnotations(), enableMetadata(), export(), get(), getAccessID(), getAnnotations(), getAnnotationsAvg(), getAnnotationsMax(), getAnnotationsMin(), getAnnotationsSum(), getCalendarEndTime(), getCalendarStartTime(), getContainerEntity(), getContainerGUID(), getEntitiesFromRelationship(), getGUID(), getIconURL(), getLatitude(), getLocation(), getLongitude(), getMetaData(), getObjectFromID(), getOwnerEntity(), getPrivateSetting(), getSubtype(), getSystemLogID(), getTags(), getTimeUpdated(), getType(), getURL(), getVolatileData(), import(), isEnabled(), isFullyLoaded(), removePrivateSetting(), removeRelationship(), set(), setCalendarTimeAndDuration(), setContainerGUID(), setLatLong(), setLocation(), setMetaData(), setPrivateSetting(), setURL(), setVolatileData()
Methods inherited from ElggData
__isset(), current(), getClassName(), getTimeCreated(), key(), next(), offsetExists(), offsetGet(), offsetSet(), offsetUnset(), rewind(), valid()
Properties inherited from ElggEntity
$icon_override, $temp_annotations, $temp_metadata, $temp_private_settings, $url_override, $volatile
Properties inherited from ElggData
$attributes, $valid
Magic properties summary
public string $name
#

The display name that the user will be known by in the network

The display name that the user will be known by in the network

public string $username
#

The short, reference name for the user in the network

The short, reference name for the user in the network

public string $email
#

The email address to which Elgg will send email notifications

The email address to which Elgg will send email notifications

public string $language
#

The language preference of the user (ISO 639-1 formatted)

The language preference of the user (ISO 639-1 formatted)

public string $banned
#

'yes' if the user is banned from the network, 'no' otherwise

'yes' if the user is banned from the network, 'no' otherwise

public string $admin
#

'yes' if the user is an administrator of the network, 'no' otherwise

'yes' if the user is an administrator of the network, 'no' otherwise

public string $password
#

The hashed password of the user

The hashed password of the user

public string $salt
#

The salt used to secure the password before hashing

The salt used to secure the password before hashing

Magic properties inherited from ElggEntity
$access_id, $container_guid, $enabled, $guid, $owner_guid, $site_guid, $subtype, $time_created, $time_updated, $type
API documentation generated by ApiGen 2.8.0