Class lispa\amos\community\utilities\CommunityUtil

Inheritancelispa\amos\community\utilities\CommunityUtil

Class CommunityUtil

Public Methods

Hide inherited methods

MethodDescriptionDefined By
canDeleteCommunity() lispa\amos\community\utilities\CommunityUtil
confirmCommunityManager() Method useful to confirm a community manager. The method return true only if it found the manager in the to confirm state and the update goes fine. lispa\amos\community\utilities\CommunityUtil
getAllCommunityContexts() This method return a string array of community context classnames present in the community table. lispa\amos\community\utilities\CommunityUtil
getAllCommunityManagerRoles() This method return a string array of community managers of all community contexts. lispa\amos\community\utilities\CommunityUtil
getAllValidatedCommunity() lispa\amos\community\utilities\CommunityUtil
getCommunitiesByRoleAndUserId() lispa\amos\community\utilities\CommunityUtil
getCommunitiesByUserId() This method return an array of Community objects representing all the communities of a specific user. lispa\amos\community\utilities\CommunityUtil
getCommunitiesManagedByUserId() lispa\amos\community\utilities\CommunityUtil
getCommunitiesParticipateByUserId() lispa\amos\community\utilities\CommunityUtil
getCommunityAndSubcommunitiesIds() lispa\amos\community\utilities\CommunityUtil
getCommunityAndSubcommunitiesIdsRecursive() lispa\amos\community\utilities\CommunityUtil
getCurrentCommunityMembers() Return CommunityUserMms of current community lispa\amos\community\utilities\CommunityUtil
getParentList() Get the list of communities of which the user has permission to create subcommunities lispa\amos\community\utilities\CommunityUtil
hasRole() lispa\amos\community\utilities\CommunityUtil
isLoggedCommunityManager() lispa\amos\community\utilities\CommunityUtil
isManagerLoggedUser() lispa\amos\community\utilities\CommunityUtil
loggedUserIsCommunityManager() This method checks if the logged user is a community manager for the community in param. lispa\amos\community\utilities\CommunityUtil
loggedUserIsParticipant() This method checks if the logged user is a participant for the community in param. lispa\amos\community\utilities\CommunityUtil
translateArrayValues() This method translate the array values. lispa\amos\community\utilities\CommunityUtil
userIsCommunityManager() This method checks if the logged user is a community manager for the community in param. lispa\amos\community\utilities\CommunityUtil
userIsParticipant() This method checks if the logged user is a participant for the community in param. lispa\amos\community\utilities\CommunityUtil
userIsSignedUp() lispa\amos\community\utilities\CommunityUtil

Method Details

canDeleteCommunity() public static method

public static boolean canDeleteCommunity ( $community )
$community lispa\amos\community\models\Community
confirmCommunityManager() public static method

Method useful to confirm a community manager. The method return true only if it found the manager in the to confirm state and the update goes fine.

public static boolean confirmCommunityManager ( $communityId, $userId, $managerRole )
$communityId integer
$userId integer
$managerRole string
getAllCommunityContexts() public static method

This method return a string array of community context classnames present in the community table.

public static array getAllCommunityContexts ( )
getAllCommunityManagerRoles() public static method

This method return a string array of community managers of all community contexts.

public static array getAllCommunityManagerRoles ( )
getAllValidatedCommunity() public static method

public static lispa\amos\community\models\Community[] getAllValidatedCommunity ( )
getCommunitiesByRoleAndUserId() public static method

public static lispa\amos\community\models\Community[]|integer[]|yii\db\ActiveQuery getCommunitiesByRoleAndUserId ( $userId, $role, $onlyIds false, $returnQuery false, $ignoreValidatedOnce false )
$userId integer
$role string
$onlyIds boolean
$returnQuery boolean

IF true return the ActiveQuery object

$ignoreValidatedOnce boolean
throws lispa\amos\community\exceptions\CommunityException
getCommunitiesByUserId() public static method

This method return an array of Community objects representing all the communities of a specific user.

The list includes the communities validated at least once in the generic context (Community) and the user must have the active status in CommunityUserMm.

public static lispa\amos\community\models\Community[]|integer[]|yii\db\ActiveQuery getCommunitiesByUserId ( $userId, $onlyIds false, $returnQuery false, $ignoreValidatedOnce false )
$userId integer
$onlyIds boolean
$returnQuery boolean
$ignoreValidatedOnce
throws lispa\amos\community\exceptions\CommunityException
getCommunitiesManagedByUserId() public static method

public static lispa\amos\community\models\Community[]|integer[]|yii\db\ActiveQuery getCommunitiesManagedByUserId ( $userId, $onlyIds false, $returnQuery false, $ignoreValidatedOnce false )
$userId integer
$onlyIds boolean
$returnQuery boolean

IF true return the ActiveQuery object

$ignoreValidatedOnce boolean
throws lispa\amos\community\exceptions\CommunityException
getCommunitiesParticipateByUserId() public static method

public static lispa\amos\community\models\Community[]|integer[]|yii\db\ActiveQuery getCommunitiesParticipateByUserId ( $userId, $onlyIds false, $returnQuery false, $ignoreValidatedOnce false )
$userId integer
$onlyIds boolean
$returnQuery boolean

IF true return the ActiveQuery object

$ignoreValidatedOnce boolean
throws lispa\amos\community\exceptions\CommunityException
getCommunityAndSubcommunitiesIds() public static method

public static integer[] getCommunityAndSubcommunitiesIds ( $community )
$community lispa\amos\community\models\Community
getCommunityAndSubcommunitiesIdsRecursive() public static method

public static integer[] getCommunityAndSubcommunitiesIdsRecursive ( $community )
$community lispa\amos\community\models\Community
getCurrentCommunityMembers() public static method

Return CommunityUserMms of current community

public static yii\db\ActiveQuery getCurrentCommunityMembers ( )
getParentList() public static method

Get the list of communities of which the user has permission to create subcommunities

public static array getParentList ( $userId null, $parentId null )
$userId integer|null
  • if null the logged user id is considered
$parentId integer|null
  • The only parent community to choose if a community creation process started from a the community with id $parentId
return array

[communityId] = community->name

hasRole() public static method

public static boolean hasRole ( $model )
$model

Community

isLoggedCommunityManager() public static method

public static void isLoggedCommunityManager ( )
isManagerLoggedUser() public method

public boolean isManagerLoggedUser ( $model )
$model lispa\amos\community\models\Community
loggedUserIsCommunityManager() public static method

This method checks if the logged user is a community manager for the community in param.

public static boolean loggedUserIsCommunityManager ( $communityId )
$communityId integer
loggedUserIsParticipant() public static method

This method checks if the logged user is a participant for the community in param.

public static boolean loggedUserIsParticipant ( $communityId )
$communityId integer
throws lispa\amos\community\exceptions\CommunityException
translateArrayValues() public static method

This method translate the array values.

public static array translateArrayValues ( $arrayValues )
$arrayValues array
userIsCommunityManager() public static method

This method checks if the logged user is a community manager for the community in param.

public static boolean userIsCommunityManager ( $communityId, $userId )
$communityId integer
$userId integer
userIsParticipant() public static method

This method checks if the logged user is a participant for the community in param.

public static boolean userIsParticipant ( $communityId, $userId )
$communityId integer
$userId integer
throws lispa\amos\community\exceptions\CommunityException
userIsSignedUp() public static method

public static boolean userIsSignedUp ( $communityId, $userId )
$communityId integer
$userId integer