Campustream 1.0
A social network MQP for WPI
User_Model Class Reference
Inheritance diagram for User_Model:
ActiveRecord SessionObject

Public Member Functions

 get_session_params ()
 get_session_secret ()
 get_session_key ()
 facebook ()
 has_facebook ()
 facebook_api ()
 fb_prepare ($data)
 twitter ()
 has_twitter ()
 twitter_api ()
 avatar_url ($size= 'medium', $placeholder=false)
 avatar_path ($size= 'medium', $format=false)
 follow ($user)
 unfollow ($user)
 follows ()
 followers ()
 is_followed_by ($user)
 is_following ($user)
 follows_count ()
 followers_count ()
 __get ($key)
 __set ($key, $value)

Static Public Member Functions

static get_session_object ($user_id)
static find_user_for_login ($username, $password, $is_hashed=false)

Data Fields

 $columns = array('id', 'username', 'name', 'bio', 'website', 'college_majors', 'college_minors', 'class_year', 'email', 'password', 'join_date', 'has_avatar', 'avatar_format', 'current_status', 'karma', 'confirmed', 'confirm_code', 'email_enabled')
 $cache_keys = array( 'user/#' => 'id', 'user/name:#' => 'username' )
 $has_many = array()
 $public_columns = array( 'id', 'username', 'name', 'bio', 'website', 'college_majors', 'college_minors', 'class_year', 'join_date', 'current_status', 'follows_count', 'followers_count', 'avatar', 'karma')
 $facebook

Detailed Description

Represents a single user, which also represents sessions in Hub

Definition at line 6 of file user.php.


Member Function Documentation

__get ( key)

Reimplemented from ActiveRecord.

Definition at line 305 of file user.php.

__set ( key,
value 
)

Reimplemented from ActiveRecord.

Definition at line 329 of file user.php.

avatar_path ( size = 'medium',
format = false 
)

Return the absolute path to the avatar directory

Definition at line 180 of file user.php.

avatar_url ( size = 'medium',
placeholder = false 
)

Retrieve the URL to this users avavar

Parameters:
$sizeSmall, medium or large
$placeholderForce returning a placeholder avatar

Definition at line 169 of file user.php.

facebook ( )

Load and return Facebook information related to this user

Definition at line 71 of file user.php.

facebook_api ( )

Create a Facebook API instance using thi user's account

Definition at line 97 of file user.php.

fb_prepare ( data)

Prepares a Facebook request

Definition at line 114 of file user.php.

static find_user_for_login ( username,
password,
is_hashed = false 
) [static]

Given a username and password, find the corresponding user. If the username and/or password is invalid, throw an exception.

Definition at line 50 of file user.php.

follow ( user)

Follow the given user

Definition at line 193 of file user.php.

followers ( )

Get all users who follow this user

Definition at line 230 of file user.php.

followers_count ( )

How many users follow this user?

Definition at line 281 of file user.php.

follows ( )

Get all users this user follows

Definition at line 217 of file user.php.

follows_count ( )

How many users does this user follow?

Definition at line 269 of file user.php.

get_session_key ( )

Implements SessionObject.

Definition at line 42 of file user.php.

static get_session_object ( user_id) [static]

Implements SessionObject.

Definition at line 16 of file user.php.

get_session_params ( )

Implements SessionObject.

Definition at line 34 of file user.php.

get_session_secret ( )

Implements SessionObject.

Definition at line 38 of file user.php.

has_facebook ( )

Has this user connected their Facebook account?

Definition at line 90 of file user.php.

has_twitter ( )

Has this user connected their Twitter account?

Definition at line 148 of file user.php.

is_followed_by ( user)

Is this user followed by the given user?

Definition at line 243 of file user.php.

is_following ( user)

Is this user following the given user?

Definition at line 256 of file user.php.

twitter ( )

Load and return Twitter information about this user

Definition at line 129 of file user.php.

twitter_api ( )

Retrieve a Twitter API connection with this user's account

Definition at line 155 of file user.php.

unfollow ( user)

Unfollow the given user

Definition at line 205 of file user.php.


Field Documentation

$cache_keys = array( 'user/#' => 'id', 'user/name:#' => 'username' )

Definition at line 9 of file user.php.

$columns = array('id', 'username', 'name', 'bio', 'website', 'college_majors', 'college_minors', 'class_year', 'email', 'password', 'join_date', 'has_avatar', 'avatar_format', 'current_status', 'karma', 'confirmed', 'confirm_code', 'email_enabled')

Reimplemented from ActiveRecord.

Definition at line 8 of file user.php.

$facebook

Definition at line 13 of file user.php.

$has_many = array()

Reimplemented from ActiveRecord.

Definition at line 10 of file user.php.

$public_columns = array( 'id', 'username', 'name', 'bio', 'website', 'college_majors', 'college_minors', 'class_year', 'join_date', 'current_status', 'follows_count', 'followers_count', 'avatar', 'karma')

Definition at line 11 of file user.php.


The documentation for this class was generated from the following file: