Folks_Friends_prefs
extends Folks_Friends
in package
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.
Tags
Table of Contents
- $_cache : Horde_Cache
- String cache reference
- $_params : array<string|int, mixed>
- Hash containing connection parameters.
- $_user : string
- String containing user
- $instances : mixed
- Friends instances
- 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
- 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 avaiable 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
- Add user to a blacklist list
- removeFriend() : mixed
- Remove user from a fiend list
- 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
- _addrem_lists() : mixed
- Add/remove a user from a list
- _getAdmins() : mixed
- Get administartor usernames
- _lists() : array<string|int, mixed>
- 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
- factory() : Folks_Friends
- Attempts to return a concrete Folks_Friends instance based on $friends.
Properties
$_cache
String cache reference
protected
Horde_Cache
$_cache
$_params
Hash containing connection parameters.
protected
array<string|int, mixed>
$_params
= array()
$_user
String containing user
protected
string
$_user
$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 —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() : array<string|int, mixed>
Return values
array<string|int, mixed> —of users
getGroupOwner()
Get user owning group
public
getGroupOwner(mixed $group) : mixed
Parameters
- $group : mixed
Return values
mixed —getGroups()
Get avaiable 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()
Add user to a 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) : mixed
Parameters
- $friend : string
-
Friend's usersame
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 —_addrem_lists()
Add/remove a user from a list
private
_addrem_lists(string $type, string $user) : mixed
Parameters
- $type : string
-
of the list
- $user : string
-
user to applay
Return values
mixed —_getAdmins()
Get administartor usernames
private
_getAdmins() : mixed
Return values
mixed —_lists()
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
private
_lists(string $type[, string $user = null ]) : array<string|int, mixed>
Parameters
- $type : string
-
List type to retreive
- $user : string = null
-
Username to check
Return values
array<string|int, mixed> —$list array fo usernames
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.