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

$_capabilities

$_capabilities : array

An array of capabilities, so that the driver can report which operations it supports and which it doesn't.

Type

array

$_db

$_db : \DB

Handle for the current database connection.

Type

\DB

$_write_db

$_write_db : \DB

Handle for the current database connection, used for writing. Defaults to the same handle as $_db if a separate write database is not required.

Type

\DB

$instances

$instances : 

Friends instances

Type

$_shares

$_shares : integer

Share holder

Type

integer

Methods

waitingApprovalFrom()

waitingApprovalFrom() 

Get friends that does not confirm the current user yet

waitingApprovalFor()

waitingApprovalFor() 

User that we do not confirm them user yet

friendOf()

friendOf() : array

Get users who have us on their friendlist

Returns

array —

users

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)

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

getGroupOwner()

getGroupOwner(  $group) 

Get user owning group

Parameters

$group

getGroups()

getGroups() 

Get user groups

renameGroup()

renameGroup(integer  $group,   $name) 

Rename user group

Parameters

integer $group

Group ID to delete

$name

removeGroup()

removeGroup(integer  $group) 

Delete user group

Parameters

integer $group

Group ID to delete

addGroup()

addGroup(  $name) 

Add group

Parameters

$name

Throws

\Horde_Share_Exception

__construct()

__construct(array  $params) 

Construct object

Parameters

array $params

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

_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

_addFriend()

_addFriend(string  $friend) 

Add user to a friend list

Parameters

string $friend

Friend's usersame

_approveFriend()

_approveFriend(string  $friend) 

Approve our friend to add us to his userlist

Parameters

string $friend

Friedn username

_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 user's friends

_getGroups()

_getGroups() 

Get user groups

_connect()

_connect() : boolean

Attempts to open a persistent connection to the SQL server.

Throws

\Horde_Exception

Returns

boolean —

True on success.

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