All Data Structures Functions Variables Pages
Static Public Member Functions | Static Protected Member Functions
MissionsUtil Class Reference

Static Public Member Functions

static renderDescriptionAndLatestForDisplayView (Mission $mission)
 
static markUserHasReadLatest (Mission $mission, User $user)
 
static markUserHasUnreadLatest (Mission $mission, User $user)
 
static hasUserReadMissionLatest (Mission $mission, User $user)
 
static markAllUserHasReadLatestExceptOwnerAndTakenBy (Mission $mission)
 
static markAllUserHasUnreadLatest (Mission $mission)
 
static makeActiveActionElementType ($type)
 
static makeDataProviderByType (Mission $mission, $type, $pageSize)
 
static makeAndSubmitStatusChangeNotificationMessage (User $userToReceiveMessage, $missionId, $messageContent)
 
static makeAndSubmitNewCommentNotificationMessage (User $userToReceiveMessage)
 
static makeAndSubmitNewMissionNotificationMessage (Mission $mission)
 
static getEmailSubject (Mission $mission)
 
static resolvePeopleToSendNotificationToOnNewMission (Mission $mission)
 
static resolvePeopleToSendNotificationToOnNewComment (Mission $mission, User $user)
 

Static Protected Member Functions

static getTextContentForNotificationMessage (Mission $mission)
 
static getHtmlContentForNotificationMessage (Mission $mission)
 

Detailed Description

Helper class for working with missions

Definition at line 40 of file MissionsUtil.php.

Member Function Documentation

static renderDescriptionAndLatestForDisplayView ( Mission  $mission)
static

Renders string content for the mission description or the latest mission comment if it exists.

Parameters
Mission$mission
Returns
string

Definition at line 48 of file MissionsUtil.php.

static markUserHasReadLatest ( Mission  $mission,
User  $user 
)
static
Parameters
Mission$mission
User$user

Definition at line 62 of file MissionsUtil.php.

static markUserHasUnreadLatest ( Mission  $mission,
User  $user 
)
static
Parameters
Mission$mission
User$user

Definition at line 73 of file MissionsUtil.php.

static hasUserReadMissionLatest ( Mission  $mission,
User  $user 
)
static
Parameters
Mission$mission
User$user
Returns
bool

Definition at line 85 of file MissionsUtil.php.

static markAllUserHasReadLatestExceptOwnerAndTakenBy ( Mission  $mission)
static
Parameters
Mission$mission

Definition at line 95 of file MissionsUtil.php.

static markAllUserHasUnreadLatest ( Mission  $mission)
static
Parameters
Mission$mission

Definition at line 111 of file MissionsUtil.php.

static makeActiveActionElementType (   $type)
static
Parameters
int$type
Returns
string
Exceptions
NotSupportedException

Definition at line 125 of file MissionsUtil.php.

static makeDataProviderByType ( Mission  $mission,
  $type,
  $pageSize 
)
static
Parameters
Mission$mission
int$type
int$pageSize
Returns
RedBeanModelDataProvider'

Definition at line 156 of file MissionsUtil.php.

static makeAndSubmitStatusChangeNotificationMessage ( User  $userToReceiveMessage,
  $missionId,
  $messageContent 
)
static

Create and submit a notification when a status changes.

Parameters
User$userToReceiveMessage
integer$missionId
string$messageContent

Definition at line 186 of file MissionsUtil.php.

static makeAndSubmitNewCommentNotificationMessage ( User  $userToReceiveMessage)
static

Create at most one notification for a user when there are new unread comments.

Parameters
User$userToReceiveMessage
integer$missionId
string$messageContent

Definition at line 211 of file MissionsUtil.php.

static makeAndSubmitNewMissionNotificationMessage ( Mission  $mission)
static
Parameters
Mission$mission

Definition at line 226 of file MissionsUtil.php.

static getTextContentForNotificationMessage ( Mission  $mission)
staticprotected
Parameters
Mission$mission
Returns
string

Definition at line 248 of file MissionsUtil.php.

static getHtmlContentForNotificationMessage ( Mission  $mission)
staticprotected
Parameters
Mission$mission
Returns
string

Definition at line 266 of file MissionsUtil.php.

static getEmailSubject ( Mission  $mission)
static
Parameters
Mission$mission
Returns
string

Definition at line 285 of file MissionsUtil.php.

static resolvePeopleToSendNotificationToOnNewMission ( Mission  $mission)
static
Parameters
Mission$mission
Returns
array

Definition at line 294 of file MissionsUtil.php.

static resolvePeopleToSendNotificationToOnNewComment ( Mission  $mission,
User  $user 
)
static

Given a Mission and the User that created the new comment return the people on the mission to send new notification to

Parameters
Mission$mission
User$user
Returns
Array $peopleToSendNotification

Definition at line 316 of file MissionsUtil.php.


The documentation for this class was generated from the following file:
Generated on Tue Jan 21 2020 07:10:41