Documentation

Folks_Friends_shared extends Folks_Friends_sql
in package

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

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.

Tags
author

Duck duck@obala.net

Table of Contents

$_cache  : Horde_Cache
String cache reference
$_capabilities  : array<string|int, mixed>
An array of capabilities, so that the driver can report which operations it supports and which it doesn't.
$_params  : array<string|int, mixed>
Hash containing connection parameters.
$_user  : string
String containing user
$_db  : DB
Handle for the current database connection.
$_shares  : int
Share holder
$_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.
$instances  : mixed
Friends instances
addBlacklisted()  : mixed
Add user to a blacklist list
addFriend()  : mixed
Add user to a friend list
addGroup()  : mixed
Add group
approveFriend()  : mixed
Approve our friend to add us to his userlist
friendOf()  : array<string|int, mixed>
Get users who have us on their friendlist
getBlacklist()  : array<string|int, mixed>
Get user blacklist
getFriends()  : array<string|int, mixed>
Get user friends
getGroupOwner()  : mixed
Get user owning group
getGroups()  : mixed
Get user groups
getPossibleFriends()  : array<string|int, mixed>
Return all friends of out frends and make a top list of common users
hasCapability()  : bool
Queries the current object to find out if it supports the given capability.
isBlacklisted()  : bool
Check if user is on blacklist
isFriend()  : bool
Check if user is on blacklist
needsApproval()  : bool
Check if a users requies his approval to be added as a friend
removeBlacklisted()  : mixed
Remove user from blacklist list
removeFriend()  : mixed
Remove user from a fiend list
removeGroup()  : mixed
Delete user group
renameGroup()  : mixed
Rename user group
sendNotification()  : bool
Send user a nofication or approve request
singleton()  : mixed
Singleton for driver object
waitingApprovalFor()  : mixed
User that we do not confirm them user yet
waitingApprovalFrom()  : mixed
Get friends that does not confirm the current user yet
__construct()  : mixed
Construct object
_addBlacklisted()  : mixed
Add user to a blacklist list
_addFriend()  : mixed
Add user to a friend list
_approveFriend()  : mixed
Approve our friend to add us to his userlist
_connect()  : bool
Attempts to open a persistent connection to the SQL server.
_getBlacklist()  : array<string|int, mixed>
Get user blacklist
_getFriends()  : array<string|int, mixed>
Get user friends
_getGroups()  : mixed
Get user groups
_removeBlacklisted()  : mixed
Remove user from blacklist list
_removeFriend()  : mixed
Remove user from a fiend list
_getAdmins()  : mixed
Get administartor usernames
factory()  : Folks_Friends
Attempts to return a concrete Folks_Friends instance based on $friends.

Properties

$_cache

String cache reference

protected Horde_Cache $_cache

$_capabilities

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

protected array<string|int, mixed> $_capabilities = array('groups_add' => rue)

$_params

Hash containing connection parameters.

protected array<string|int, mixed> $_params = array()

$_user

String containing user

protected string $_user

$_db

Handle for the current database connection.

private DB $_db

$_shares

Share holder

private int $_shares

$_write_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.

private DB $_write_db

$instances

Friends instances

private static mixed $instances = array()

Methods

addBlacklisted()

Add user to a blacklist list

public addBlacklisted(string $user) : mixed
Parameters
$user : string

Usersame

Return values
mixed

addFriend()

Add user to a friend list

public addFriend(string $friend[, string $group = null ]) : mixed
Parameters
$friend : string

Friend's usersame

$group : string = null

Group to add friend to

Return values
mixed

addGroup()

Add group

public addGroup(mixed $name) : mixed
Parameters
$name : mixed
Tags
throws
Horde_Share_Exception
Return values
mixed

approveFriend()

Approve our friend to add us to his userlist

public approveFriend(string $friend) : mixed
Parameters
$friend : string

Friend username

Return values
mixed

friendOf()

Get users who have us on their friendlist

public friendOf() : array<string|int, mixed>
Return values
array<string|int, mixed>

users

getBlacklist()

Get user blacklist

public getBlacklist() : array<string|int, mixed>
Return values
array<string|int, mixed>

of users blacklist

getFriends()

Get user friends

public getFriends([string $group = null ]) : array<string|int, mixed>
Parameters
$group : string = null

Get friens only from this group

Return values
array<string|int, mixed>

of users (in group)

getGroupOwner()

Get user owning group

public getGroupOwner(mixed $group) : mixed
Parameters
$group : mixed
Return values
mixed

getGroups()

Get user groups

public getGroups() : mixed
Return values
mixed

getPossibleFriends()

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

public getPossibleFriends(int $limit) : array<string|int, mixed>
Parameters
$limit : int

Users

Return values
array<string|int, mixed>

users

hasCapability()

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

public hasCapability(string $capability) : bool
Parameters
$capability : string

The capability to test for.

Return values
bool

Whether or not the capability is supported.

isBlacklisted()

Check if user is on blacklist

public isBlacklisted(string $user) : bool
Parameters
$user : string

User to check

Return values
bool

isFriend()

Check if user is on blacklist

public isFriend(string $user) : bool
Parameters
$user : string

User to check

Return values
bool

needsApproval()

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

public needsApproval(string $user) : bool
Parameters
$user : string

Usersame

Return values
bool

removeBlacklisted()

Remove user from blacklist list

public removeBlacklisted(string $user) : mixed
Parameters
$user : string

Usersame

Return values
mixed

removeFriend()

Remove user from a fiend list

public removeFriend(string $friend[, string $group = null ]) : mixed
Parameters
$friend : string

Friend's usersame

$group : string = null

Group to remove friend from

Return values
mixed

removeGroup()

Delete user group

public removeGroup(int $group) : mixed
Parameters
$group : int

Group ID to delete

Return values
mixed

renameGroup()

Rename user group

public renameGroup(int $group, mixed $name) : mixed
Parameters
$group : int

Group ID to delete

$name : mixed
Return values
mixed

sendNotification()

Send user a nofication or approve request

public sendNotification(string $user, string $title, string $body) : bool
Parameters
$user : string

Usersame

$title : string

Title of notification

$body : string

Content of notification

Return values
bool

singleton()

Singleton for driver object

public static singleton([mixed $driver = null ][, array<string|int, mixed> $params = null ]) : mixed
Parameters
$driver : mixed = null
$params : array<string|int, mixed> = null

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

Return values
mixed

waitingApprovalFor()

User that we do not confirm them user yet

public waitingApprovalFor() : mixed
Return values
mixed

waitingApprovalFrom()

Get friends that does not confirm the current user yet

public waitingApprovalFrom() : mixed
Return values
mixed

__construct()

Construct object

protected __construct(array<string|int, mixed> $params) : mixed
Parameters
$params : array<string|int, mixed>

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

Return values
mixed

_addBlacklisted()

Add user to a blacklist list

protected _addBlacklisted(string $user) : mixed
Parameters
$user : string

Usersame

Return values
mixed

_addFriend()

Add user to a friend list

protected _addFriend(string $friend) : mixed
Parameters
$friend : string

Friend's usersame

Return values
mixed

_approveFriend()

Approve our friend to add us to his userlist

protected _approveFriend(string $friend) : mixed
Parameters
$friend : string

Friedn username

Return values
mixed

_connect()

Attempts to open a persistent connection to the SQL server.

protected _connect() : bool
Tags
throws
Horde_Exception
Return values
bool

True on success.

_getBlacklist()

Get user blacklist

protected _getBlacklist() : array<string|int, mixed>
Return values
array<string|int, mixed>

of users blacklist

_getFriends()

Get user friends

protected _getFriends() : array<string|int, mixed>
Return values
array<string|int, mixed>

of user's friends

_getGroups()

Get user groups

protected _getGroups() : mixed
Return values
mixed

_removeBlacklisted()

Remove user from blacklist list

protected _removeBlacklisted(string $user) : mixed
Parameters
$user : string

Usersame

Return values
mixed

_removeFriend()

Remove user from a fiend list

protected _removeFriend(string $friend) : mixed
Parameters
$friend : string

Friend's usersame

Return values
mixed

_getAdmins()

Get administartor usernames

private _getAdmins() : mixed
Return values
mixed

factory()

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

private static factory([mixed $driver = null ][, array<string|int, mixed> $params = null ]) : Folks_Friends
Parameters
$driver : mixed = null
$params : array<string|int, mixed> = null

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

Return values
Folks_Friends

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

Search results