Class Users - echiong/testRepo GitHub Wiki

##Class Users

Users class handles user detail operations.

Package: [[application<a href="Package application.controlllers.md">controlllers]]
Extends: Framework_controller
Located at application/controllers/users.php

##Methods summary


public details ( integer $userID = null )

Displays a user's profile page.

Parameters

$userID integer
$userID User record id.

Uses Users_model::get() Components_model::user() Feats::feats_model()


public string follow_user ( )

Follow user endpoint - tag a user to follow

Returns string
Returns nok or an error message otherwise

Uses Users_model::follow() Notifications_model::from() Notifications_model::to() Notifications_model::create()


public string unfollow_user ( )

Unfollow user endpoint - remove follow user tag

Returns string
Returns ok or an error message otherwise.

Uses Users_model::unfollow()


public string follow_stat ( )

Follow_stat Endpoint - checks the status of current user with the user displayed in the follow button

Returns string
Returns ok meaning 'user can follow', nok meaning 'user is already following' or an error message otherwise.


public object followed_list ( )

Followed List Endpoint - retrieves a users followed list.

Returns object
JSON encoded list of user followed.


public string add_favorite ( )

Add favorite endpoint - tag the component as favorite

Returns string
Returns nok or an error message otherwise.

Uses Components_model::get() Components_model::increment_stat() SeenContent_model::create()


public boolean|object favorite_stat ( string $component = null, integer $id = null, boolean $stat = TRUE )

Favorite stat endpoint - returns the favorite status of a component with regards to the current user

Parameters

$component string
$component Component type.

$id integer
$id Component record id.

$stat boolean
$stat Set to true to include current number of favorites of a component in json format.

Returns boolean|object
When stat parameter is set: returns true meaning user has yet to add as favorite or false, user has already added as favorite. Otherwise returns a JSON encoded object with status: ok/nok, and ctr: number of favorites.


public object favorite_list ( string $component )

Favorite List Endpoint - retrieves a users component favorite list.

Parameters

$component string
$component Component type.

Returns object
JSON encoded list of ids added as favorite.


public feat_request ( )

Displays a user's Feat Request page.


public string feat_request_response ( )

Endpoint to handle Feat Request responses.

Returns string
Returns ok on success or an error message on failure.


public object notifications ( )

Endpoint that returns notification entries.

Returns object
JSON encoded list of notifications.

Uses Notifications_model::notifications()


public reset_notifications ( )

Uses Notifications_model::reset_notifications()

⚠️ **GitHub.com Fallback** ⚠️