\Folks_Friends_prefs

Folks internal firends implementaton

NOTE: You must add this prefs to your application

$_prefs['whitelist'] = array( 'value' => '', 'locked' => false, 'type' => 'implicit' );

$_prefs['blacklist'] = array( 'value' => '', 'locked' => false, 'type' => 'implicit' );

Copyright 2007-2017 Horde LLC (http://www.horde.org/)

See the enclosed file LICENSE for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.

Summary

Methods
Properties
Constants
singleton()
hasCapability()
needsApproval()
sendNotification()
getBlacklist()
addBlacklisted()
removeBlacklisted()
isBlacklisted()
addFriend()
removeFriend()
getFriends()
waitingApprovalFrom()
waitingApprovalFor()
approveFriend()
isFriend()
getPossibleFriends()
friendOf()
getGroupOwner()
getGroups()
No public properties found
No constants found
__construct()
_approveFriend()
_addFriend()
_addBlacklisted()
$_params
$_user
$_cache
N/A
factory()
_getAdmins()
_lists()
_addrem_lists()
$instances
N/A

Properties

$_params

$_params : array

Hash containing connection parameters.

Type

array

$_user

$_user : string

String containing user

Type

string

$_cache

$_cache : \Horde_Cache

String cache reference

Type

\Horde_Cache

$instances

$instances : 

Friends instances

Type

Methods

singleton()

singleton(  $driver = null, array  $params = null) 

Singleton for driver object

Parameters

$driver
array $params

A hash containing any additional configuration or connection parameters a subclass might need.

hasCapability()

hasCapability(string  $capability) : boolean

Queries the current object to find out if it supports the given capability.

Parameters

string $capability

The capability to test for.

Returns

boolean —

Whether or not the capability is supported.

needsApproval()

needsApproval(string  $user) : boolean

Check if a users requies his approval to be added as a friend

Parameters

string $user

Usersame

Returns

boolean

sendNotification()

sendNotification(string  $user, string  $title, string  $body) : boolean

Send user a nofication or approve request

Parameters

string $user

Usersame

string $title

Title of notification

string $body

Content of notification

Returns

boolean

getBlacklist()

getBlacklist() : array

Get user blacklist

Returns

array —

of users blacklist

addBlacklisted()

addBlacklisted(string  $user) 

Add user to a blacklist list

Parameters

string $user

Usersame

removeBlacklisted()

removeBlacklisted(string  $user) 

Add user to a blacklist list

Parameters

string $user

Usersame

isBlacklisted()

isBlacklisted(string  $user) : boolean

Check if user is on blacklist

Parameters

string $user

User to check

Returns

boolean

addFriend()

addFriend(string  $friend, string  $group = null) 

Add user to a friend list

Parameters

string $friend

Friend's usersame

string $group

Group to add friend to

removeFriend()

removeFriend(string  $friend) 

Remove user from a fiend list

Parameters

string $friend

Friend's usersame

getFriends()

getFriends() : array

Get user friends

Returns

array —

of users

waitingApprovalFrom()

waitingApprovalFrom() 

Get friends that does not confirm the current user yet

waitingApprovalFor()

waitingApprovalFor() 

User that we do not confirm them user yet

approveFriend()

approveFriend(string  $friend) 

Approve our friend to add us to his userlist

Parameters

string $friend

Friend username

isFriend()

isFriend(string  $user) : boolean

Check if user is on blacklist

Parameters

string $user

User to check

Returns

boolean

getPossibleFriends()

getPossibleFriends(integer  $limit) : array

Return all friends of out frends and make a top list of common users

Parameters

integer $limit

Users

Returns

array —

users

friendOf()

friendOf() : array

Get users who have us on their friendlist

Returns

array —

users

getGroupOwner()

getGroupOwner(  $group) 

Get user owning group

Parameters

$group

getGroups()

getGroups() 

Get avaiable groups

__construct()

__construct(array  $params) 

Construct object

Parameters

array $params

A hash containing any additional configuration or connection parameters a subclass might need.

_approveFriend()

_approveFriend(string  $friend) 

Approve our friend to add us to his userlist

Parameters

string $friend

Friedn username

_addFriend()

_addFriend(string  $friend) 

Add user to a friend list

Parameters

string $friend

Friend's usersame

_addBlacklisted()

_addBlacklisted(string  $user) 

Add user to a blacklist list

Parameters

string $user

Usersame

factory()

factory(  $driver = null, array  $params = null) : \Folks_Friends

Attempts to return a concrete Folks_Friends instance based on $friends.

Parameters

$driver
array $params

A hash containing any additional configuration or connection parameters a subclass might need.

Returns

\Folks_Friends

The newly created concrete Folks_Friends instance, or false on an error.

_getAdmins()

_getAdmins() 

Get administartor usernames

_lists()

_lists(string  $type, string  $user = null) : array

Returns array of usernames in a list of false if list is empty splits list by any number of commas or space characters which include " ", \r, \t, \n and \f

Parameters

string $type

List type to retreive

string $user

Username to check

Returns

array —

$list array fo usernames

_addrem_lists()

_addrem_lists(string  $type, string  $user) 

Add/remove a user from a list

Parameters

string $type

of the list

string $user

user to applay