class CommunityModelFriends extends JCCModel implements CLimitsInterface, CNotificationsInterface


Located at : UKNOWVA_ROOT/components/com_community/models/friends.php

Properties

$_data
$_profile
$_pagination

Methods

__construct(array $config = array())

Constructor

from JModel
string
__toString()

Magic method to convert the object to a string gracefully.

from JObject
mixed
def(string $property, mixed $default = null)

Sets a default value if not alreay assigned

from JObject
mixed
get(string $property, mixed $default = null)

Returns a property of the object or the default value if the property is not set.

from JObject
array
getProperties(boolean $public = true)

Returns an associative array of object properties.

from JObject
string
getError(integer $i = null, boolean $toString = true)

Get the most recent error message.

from JObject
array
getErrors()

Return all errors, if any.

from JObject
mixed
set(string $property, mixed $value = null)

Modifies a property of the object, creating it if it does not already exist.

from JObject
boolean
setProperties(mixed $properties)

Set the object properties based on a named array/hash.

from JObject
void
setError(string $error)

Add an error message.

from JObject
string
toString() deprecated

No description

from JObject
static array
addIncludePath(mixed $path = '', string $prefix = '')

Add a directory where JModel should search for models. You may either pass a string or an array of directories.

from JModel
static void
addTablePath(mixed $path)

Adds to the stack of model table paths in LIFO order.

from JModel
static mixed
getInstance(string $type, string $prefix = '', array $config = array())

Returns a Model object, always creating it

from JModel
getDbo()

Method to get the database connector object

from JModel
string
getName()

Method to get the model name

from JModel
object
getState(string $property = null, mixed $default = null)

Method to get model state variables

from JModel
getTable(string $name = '', string $prefix = 'Table', array $options = array())

Method to get a table object, load it if necessary.

from JModel
void
setDbo(object $db)

Method to set the database connector object

from JModel
mixed
setState(string $property, mixed $value = null)

Method to set model state variables

from JModel
JCCModel()

No description

from JCCModel
getNotes()

No description

from JCCModel
getSample()

No description

from JCCModel
store()

No description

from JCCModel
CommunityModelFriends()

No description

addFriendCount($userId)

Deprecated since 1.8

substractFriendCount($userId)

Deprecated since 1.8

updateFriendCount($userId)

No description

getData()

No description

getFiltered($wheres = array())

No description

searchPeople(query $query)

Search for people

addFriend($id, $fromid, $msg = '', $status)

Save a friend request to stranger. Stranger will have to approve

addFriendRequest($id, $fromid)

Send a friend request to stranger. Stranger will have to approve

deleteFriendGroup($id, $groupid)

No description

deleteFriendsTag($id, $groupid)

No description

deleteSentRequest($from, $to)

Delete sent request

true
deleteFriend($conn_from, $conn_to)

delete friend connection

$result
getFriendsTag($filter = array())

Retrieve friend assigned tag

getFriendsWithTag($tagid)

Return friends with the given tag id

$tagNames
getFriendsTagNames($user_id)

Retrieve friend's tagsname and name

getPending(id $id, $created_since = null)

Get all people what are waiting to get user's approval

countPending($id)

Count total pending request.

isMyRequest($requestId, $userId)

Lets caller know if the request really belongs to the UserId

true
approveRequest(id $id)

approve the requested friend connection

true
rejectRequest(id $id)

reject the requested friend connection

getTotalToday($id)

No description

getSentRequest($id)

Get all request that the user has send but not yet approved

getPagination()

No description

getFriendIds($id)

Return an array of friend id

getFriendRecords($id)

Return an array of friend records This is a temporary solution to for the performance issue on photo page view.

getFriendsCount($id)

Return the total number of friend for the user

getInviteListByName($namePrefix, $userid, $cid, $limitstart, $limit = 8)

No description

getFriends($id, $sorted = 'latest', $useLimit = true, $filter = 'all', $maxLimit)

return the list of friend from approved connections controller need to set the id

getFriendsGroup(id $id)

return the list of friends group

getFriendConnection(connect_from $connect_from, connect_to $connect_to)

get Friend Connection

getPendingUserId($id)

No description

getTotalNotifications($userId)

Returns a list of pending friend requests for the user

Details

in JModel at line 202
JObject __construct(array $config = array())

Constructor

Parameters

array $config An array of configuration options (name, state, dbo, tablepath, ignorerequest).

Return Value

JObject

in JObject at line 56
string __toString()

Magic method to convert the object to a string gracefully.

Return Value

string The classname.

in JObject at line 70
mixed def(string $property, mixed $default = null)

Sets a default value if not alreay assigned

Parameters

string $property The name of the property.
mixed $default The default value.

Return Value

mixed

in JObject at line 88
mixed get(string $property, mixed $default = null)

Returns a property of the object or the default value if the property is not set.

Parameters

string $property The name of the property.
mixed $default The default value.

Return Value

mixed The value of the property.

See also

getProperties()

in JObject at line 107
array getProperties(boolean $public = true)

Returns an associative array of object properties.

Parameters

boolean $public If true, returns only the public properties.

Return Value

array

See also

get()

in JObject at line 133
string getError(integer $i = null, boolean $toString = true)

Get the most recent error message.

Parameters

integer $i Option error index.
boolean $toString Indicates if JError objects should return their error message.

Return Value

string Error message

in JObject at line 165
array getErrors()

Return all errors, if any.

Return Value

array Array of error messages or JErrors.

in JObject at line 180
mixed set(string $property, mixed $value = null)

Modifies a property of the object, creating it if it does not already exist.

Parameters

string $property The name of the property.
mixed $value The value of the property to set.

Return Value

mixed Previous value of the property.

in JObject at line 198
boolean setProperties(mixed $properties)

Set the object properties based on a named array/hash.

Parameters

mixed $properties Either an associative array or another object.

Return Value

boolean

See also

set()

in JObject at line 222
void setError(string $error)

Add an error message.

Parameters

string $error Error message.

Return Value

void

in JObject at line 235
string toString() deprecated

deprecated 12.1 Use magic method __toString()

Return Value

string

See also

__toString()

in JModel at line 84
static array addIncludePath(mixed $path = '', string $prefix = '')

Add a directory where JModel should search for models. You may either pass a string or an array of directories.

Parameters

mixed $path A path or array[sting] of paths to search.
string $prefix A prefix for models.

Return Value

array An array with directory elements. If prefix is equal to '', all directories are returned.

in JModel at line 123
static void addTablePath(mixed $path)

Adds to the stack of model table paths in LIFO order.

Parameters

mixed $path The directory as a string or directories as an array to add.

Return Value

void

in JModel at line 161
static mixed getInstance(string $type, string $prefix = '', array $config = array())

Returns a Model object, always creating it

Parameters

string $type The model type to instantiate
string $prefix Prefix for the model class name. Optional.
array $config Configuration array for model. Optional.

Return Value

mixed A model object or false on failure

in JModel at line 327
JDatabase getDbo()

Method to get the database connector object

Return Value

JDatabase JDatabase connector object

in JModel at line 341
string getName()

Method to get the model name

The model name. By default parsed using the classname or it can be set by passing a $config['name'] in the class constructor

Return Value

string The name of the model

in JModel at line 365
object getState(string $property = null, mixed $default = null)

Method to get model state variables

Parameters

string $property Optional parameter name
mixed $default Optional default value

Return Value

object The property where specified, the state object where omitted

in JModel at line 388
JTable getTable(string $name = '', string $prefix = 'Table', array $options = array())

Method to get a table object, load it if necessary.

Parameters

string $name The table name. Optional.
string $prefix The class prefix. Optional.
array $options Configuration array for model. Optional.

Return Value

JTable A JTable object

in JModel at line 427
void setDbo(object $db)

Method to set the database connector object

Parameters

object $db &$db A JDatabase based object

Return Value

void

in JModel at line 441
mixed setState(string $property, mixed $value = null)

Method to set model state variables

Parameters

string $property The name of the property.
mixed $value The value of the property to set or null.

Return Value

mixed The previous value of the property or null if not set.

in JCCModel at line 13
JCCModel()

in JCCModel at line 18
getNotes()

in JCCModel at line 22
getSample()

in JCCModel at line 28
store()

at line 20
CommunityModelFriends()

at line 41
addFriendCount($userId)

Deprecated since 1.8

Parameters

$userId

at line 50
substractFriendCount($userId)

Deprecated since 1.8

Parameters

$userId

at line 55
updateFriendCount($userId)

Parameters

$userId

at line 79
getData()

at line 92
getFiltered($wheres = array())

Parameters

$wheres

at line 117
searchPeople(query $query)

Search for people

Parameters

query $query string people's name to seach for

at line 155
addFriend($id, $fromid, $msg = '', $status)

Save a friend request to stranger. Stranger will have to approve

Parameters

$id
$fromid
$msg
$status

at line 196
addFriendRequest($id, $fromid)

Send a friend request to stranger. Stranger will have to approve

Parameters

$id
$fromid

at line 246
deleteFriendGroup($id, $groupid)

Parameters

$id int user id
$groupid int group id

at line 268
deleteFriendsTag($id, $groupid)

Parameters

$id int user id
$groupid int group id

at line 291
deleteSentRequest($from, $to)

Delete sent request

Parameters

$from
$to

at line 318
true deleteFriend($conn_from, $conn_to)

delete friend connection

Parameters

$conn_from int user_id should use JFactory::getUser() id
$conn_to int user_id

Return Value

true when delete success

at line 374
$result getFriendsTag($filter = array())

Retrieve friend assigned tag

Parameters

$filter array, where statement

Return Value

$result obj, records

at line 406
getFriendsWithTag($tagid)

Return friends with the given tag id

Parameters

$tagid

at line 437
$tagNames getFriendsTagNames($user_id)

Retrieve friend's tagsname and name

Parameters

$user_id int, user id

Return Value

$tagNames array, return tag names

at line 481
getPending(id $id, $created_since = null)

Get all people what are waiting to get user's approval

Parameters

id $id int userid of the user responsible for approving it
$created_since if a date is passed here, then the connections post this date will only be shown

at line 526
countPending($id)

Count total pending request.

Parameters

$id

at line 549
isMyRequest($requestId, $userId)

Lets caller know if the request really belongs to the UserId

Parameters

$requestId
$userId

at line 574
true approveRequest(id $id)

approve the requested friend connection

Parameters

id $id int the connection request id

Return Value

true if everything is ok

at line 652
true rejectRequest(id $id)

reject the requested friend connection

Parameters

id $id int the connection request id

Return Value

true if everything is ok

at line 686
getTotalToday($id)

Parameters

$id

at line 714
getSentRequest($id)

Get all request that the user has send but not yet approved

Parameters

$id

at line 764
getPagination()

at line 772
getFriendIds($id)

Return an array of friend id

Parameters

$id

at line 799
getFriendRecords($id)

Return an array of friend records This is a temporary solution to for the performance issue on photo page view.

Todo: need to support pagination on the cWindow

Parameters

$id

at line 842
getFriendsCount($id)

Return the total number of friend for the user

Parameters

$id

at line 868
getInviteListByName($namePrefix, $userid, $cid, $limitstart, $limit = 8)

Parameters

$namePrefix
$userid
$cid
$limitstart
$limit

at line 921
CUser getFriends($id, $sorted = 'latest', $useLimit = true, $filter = 'all', $maxLimit)

return the list of friend from approved connections controller need to set the id

Parameters

$id
$sorted
$useLimit
$filter
$maxLimit

Return Value

CUser objects

at line 1162
getFriendsGroup(id $id)

return the list of friends group

Parameters

id $id int user id of that person we want to search for their friend group

at line 1189
getFriendConnection(connect_from $connect_from, connect_to $connect_to)

get Friend Connection

Parameters

connect_from $connect_from int owner's id
connect_to $connect_to stranger's id return db object

at line 1211
getPendingUserId($id)

Parameters

$id

at line 1238
getTotalNotifications($userId)

Returns a list of pending friend requests for the user

Parameters

$userId