\Folks_Friends

Folks_Friends:: defines an API for implementing storage backends for Friends.

Copyright Obala d.o.o. (www.obala.si)

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()
$_params
$_user
$_cache
N/A
factory()
_getAdmins()
$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) 

Remove user from 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, string  $group = null) 

Remove user from a fiend list

Parameters

string $friend

Friend's usersame

string $group

Group to remove friend from

getFriends()

getFriends(string  $group = null) : array

Get user friends

Parameters

string $group

Get friens only from this group

Returns

array —

of users (in group)

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 user 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

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