class CommunityModelGroups extends JCCModel implements CLimitsInterface, CNotificationsInterface


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

Properties

object $_pagination Configuration data
object $total Configuration data
int $membersCount member count data

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
CommunityModelGroups()

Constructor

integer
getPagination()

Method to get a pagination object for the events

substractMembersCount($groupId)

Deprecated since 1.8, use $groupd->updateStats()->store();

addDiscussCount($groupId)

Deprecated since 1.8, use $groupd->updateStats()->store();

substractDiscussCount($groupId)

Deprecated since 1.8, use $groupd->updateStats()->store();

getMostActiveGroup()

Retrieves the most active group throughout the site.

getGroupInvites($userId, $sorting = null)

No description

type
getGroupIds($userId)

Return an array of ids the user belong to

getGroups($userId = null, $sorting = null, $useLimit = true)

Returns an object of groups which the user has registered.

getGroupsCount($userId)

Return the number of groups count for specific user

getTotalToday($userId)

No description

getGroupsCreationCount($userId)

Return the number of groups cretion count for specific user

int
getMembersCount(string $id)

Returns the count of the members of a specific group

getFriendsCount($userid, $groupid)

Return the count of the user's friend of a specific group

getInviteFriendsList($userid, $groupid)

No description

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

No description

getInvitors($userid, $groupid)

Return an object of group's invitors

Array
getAllGroups($categoryId = null, $sorting = null, $search = null, $limit = null, $skipDefaultAvatar = false)

Returns All the groups

getGroup(string $id)

Returns an object of group

getCategories($catId = COMMUNITY_ALL_CATEGORIES)

Loads the categories

getCategoriesCount()

Returns the category's group count

getCategoryName(string $categoryId)

Returns the category name of the specific category

getAdmins($groupid, $limit, $randomize = false)

Returns the members list for the specific groups

getAllMember(string $groupid)

Returns the members list for the specific groups

getMembers($groupid, $limit, $onlyApproved = true, $randomize = false, $loadAdmin = false)

No description

getInvitedMembers($groupid, $limit)

No description

groupExist($name, $id)

Check if the given group name exist.

getMembersId($groupid, $onlyApproved = false)

No description

updateGroup($data)

No description

setImage(appType $id, path $path, type $type = 'thumb')

Set the avatar for for specific group

removeMember($data)

No description

isCreator($userId, $groupId)

Check if the user is a group creator

isInvited($userid, $groupid)

Check if the user is invited in the group

isAdmin($userid, $groupid)

Check if the user is a group admin

isMember(string $userid, string $groupid)

Check if the given user is a member of the group

isWaitingAuthorization(string $userid, string $groupid)

See if the given user is waiting authorization for the group

needsApproval($id)

Gets the groups property if it requires an approval or not.

approveMember($groupid, $memberid)

Sets the member data in the group members table

deleteGroupBulletins($gid)

Delete group's bulletin

deleteGroupMembers($gid)

Delete group's member

deleteGroupWall($gid)

Delete group's wall

deleteGroupDiscussions($gid)

Delete group's discussion

deleteGroupMedia($gid)

Delete group's media

getGroupLatestDiscussion($category, $groupids = '', $limit = '')

No description

getGroupName($groupid)

Return the name of the group id

getThumbAvatar($id, $thumb) deprecated

No description

getBannedMembers($groupid, $limit, $randomize = false)

No description

getGroupsSearchTotal()

No description

getGroupChildId($gid)

No description

countPending($userId)

No description

getTotalNotifications($userId)

No description

getAdminGroups($userId, $privacy = NULL)

No description

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 48
CommunityModelGroups()

Constructor

at line 75
integer getPagination()

Method to get a pagination object for the events

Return Value

integer

at line 83
substractMembersCount($groupId)

Deprecated since 1.8, use $groupd->updateStats()->store();

Parameters

$groupId

at line 91
addDiscussCount($groupId)

Deprecated since 1.8, use $groupd->updateStats()->store();

Parameters

$groupId

at line 99
substractDiscussCount($groupId)

Deprecated since 1.8, use $groupd->updateStats()->store();

Parameters

$groupId

at line 110
CTableGroup getMostActiveGroup()

Retrieves the most active group throughout the site.

Return Value

CTableGroup The most active group table object.

at line 129
getGroupInvites($userId, $sorting = null)

Parameters

$userId
$sorting

at line 239
type getGroupIds($userId)

Return an array of ids the user belong to

Parameters

$userId

Return Value

type

at line 268
getGroups($userId = null, $sorting = null, $useLimit = true)

Returns an object of groups which the user has registered.

Parameters

$userId
$sorting
$useLimit

at line 401
getGroupsCount($userId)

Return the number of groups count for specific user

Parameters

$userId

at line 422
getTotalToday($userId)

Parameters

$userId

at line 439
getGroupsCreationCount($userId)

Return the number of groups cretion count for specific user

Parameters

$userId

at line 464
int getMembersCount(string $id)

Returns the count of the members of a specific group

Parameters

string $id Group's id.

Return Value

int Count of members

at line 488
getFriendsCount($userid, $groupid)

Return the count of the user's friend of a specific group

Parameters

$userid
$groupid

at line 509
getInviteFriendsList($userid, $groupid)

Parameters

$userid
$groupid

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

Parameters

$namePrefix
$userid
$cid
$limitstart
$limit

at line 594
getInvitors($userid, $groupid)

Return an object of group's invitors

Parameters

$userid
$groupid

at line 623
Array getAllGroups($categoryId = null, $sorting = null, $search = null, $limit = null, $skipDefaultAvatar = false)

Returns All the groups

Parameters

$categoryId
$sorting
$search
$limit
$skipDefaultAvatar

Return Value

Array An array of group objects

at line 802
getGroup(string $id)

Returns an object of group

Parameters

string $id Group Id

at line 831
getCategories($catId = COMMUNITY_ALL_CATEGORIES)

Loads the categories

Parameters

$catId

at line 875
getCategoriesCount()

Returns the category's group count

at line 903
getCategoryName(string $categoryId)

Returns the category name of the specific category

Parameters

string $categoryId Category Id

at line 929
getAdmins($groupid, $limit, $randomize = false)

Returns the members list for the specific groups

Parameters

$groupid
$limit
$randomize

at line 994
getAllMember(string $groupid)

Returns the members list for the specific groups

Parameters

string $groupid Category Id

at line 1010
getMembers($groupid, $limit, $onlyApproved = true, $randomize = false, $loadAdmin = false)

Parameters

$groupid
$limit
$onlyApproved
$randomize
$loadAdmin

at line 1101
getInvitedMembers($groupid, $limit)

Parameters

$groupid
$limit

at line 1159
groupExist($name, $id)

Check if the given group name exist.

if id is specified, only search for those NOT within $id

Parameters

$name
$id

at line 1177
getMembersId($groupid, $onlyApproved = false)

Parameters

$groupid
$onlyApproved

at line 1194
updateGroup($data)

Parameters

$data

at line 1240
setImage(appType $id, path $path, type $type = 'thumb')

Set the avatar for for specific group

Parameters

appType $id Application type. ( users , groups )
path $path The relative path to the avatars.
type $type The type of Image, thumb or avatar.

at line 1306
removeMember($data)

Parameters

$data

at line 1325
isCreator($userId, $groupId)

Check if the user is a group creator

Parameters

$userId
$groupId

at line 1345
isInvited($userid, $groupid)

Check if the user is invited in the group

Parameters

$userid
$groupid

at line 1368
isAdmin($userid, $groupid)

Check if the user is a group admin

Parameters

$userid
$groupid

at line 1421
isMember(string $userid, string $groupid)

Check if the given user is a member of the group

Parameters

string $userid userid
string $groupid groupid

at line 1443
isWaitingAuthorization(string $userid, string $groupid)

See if the given user is waiting authorization for the group

Parameters

string $userid userid
string $groupid groupid

at line 1466
needsApproval($id)

Gets the groups property if it requires an approval or not.

param string id The id of the group.

return boolean True if it requires approval and False otherwise

Parameters

$id

at line 1485
approveMember($groupid, $memberid)

Sets the member data in the group members table

param Object An object that contains the fields value

Parameters

$groupid
$memberid

at line 1509
deleteGroupBulletins($gid)

Delete group's bulletin

param string id The id of the group.

Parameters

$gid

at line 1535
deleteGroupMembers($gid)

Delete group's member

param string id The id of the group.

Parameters

$gid

at line 1560
deleteGroupWall($gid)

Delete group's wall

param string id The id of the group.

Parameters

$gid

at line 1596
deleteGroupDiscussions($gid)

Delete group's discussion

param string id The id of the group.

Parameters

$gid

at line 1662
deleteGroupMedia($gid)

Delete group's media

param string id The id of the group.

Parameters

$gid

at line 1735
getGroupLatestDiscussion($category, $groupids = '', $limit = '')

Parameters

$category
$groupids
$limit

at line 1779
getGroupName($groupid)

Return the name of the group id

Parameters

$groupid

at line 1804
getThumbAvatar($id, $thumb) deprecated

deprecated Since 2.0

Parameters

$id
$thumb

at line 1813
getBannedMembers($groupid, $limit, $randomize = false)

Parameters

$groupid
$limit
$randomize

at line 1872
getGroupsSearchTotal()

at line 1876
getGroupChildId($gid)

Parameters

$gid

at line 1932
countPending($userId)

Parameters

$userId

at line 1952
getTotalNotifications($userId)

Parameters

$userId

at line 1969
getAdminGroups($userId, $privacy = NULL)

Parameters

$userId
$privacy