Property | Type | Description | |
---|---|---|---|
$ActivityTypes | Allowed activity types. | ||
$MaxMergeCount | Limit on number of activity to combine. | ||
$Queue | Activity to be saved. |
Method | Description | |
---|---|---|
__construct ( ) | Defines the related database table name. | |
activityQuery ( boolean $Join = true ) | Build basis of common activity SQL query. | |
add ( integer $ActivityUserID, string $ActivityType, string $Story = null, integer | null $RegardingUserID = null, integer $CommentActivityID = null, string $Route = null, string | boolean $SendEmail = '' ) : integer | Add a new activity item. | |
calculateData ( &$Data ) | ||
calculateRow ( &$Row ) | ||
canDelete ( $activity ) : boolean | ||
clearNotificationQueue ( ) | Clear notification queue. | |
comment ( array $Comment ) : integer | boolean | string | Save a comment on an activity. | |
defineType ( string $Name, array $Activity = [] ) | Define a new activity type. | |
delete ( $where = [], $options = [] ) | ||
deleteComment ( integer $ID ) : Gdn_DataSet | Delete an activity comment. | |
deleteID ( integer $ActivityID, array $Options = [] ) : boolean | Delete a particular activity item. | |
email ( &$Activity, boolean $NoDelete = false ) : boolean | ||
getActivityType ( $ActivityType ) : boolean | ||
getByUser ( integer | boolean $NotifyUserID = false, integer $Offset, integer $Limit = 30 ) : Gdn_DataSet | Modifies standard Gdn_Model->Get to use AcitivityQuery. | |
getComment ( integer $ID ) : array | false | ||
getComments ( array $ActivityIDs ) : Gdn_DataSet | Get comments related to designated activity items. | |
getCount ( string $UserID = '' ) : integer | Get number of activity related to a user. | |
getCountForRole ( integer | string $RoleID = '' ) : integer | Get number of activity related to a particular role. | |
getForRole ( string $RoleID = '', integer $Offset, integer $Limit = 50 ) : Gdn_DataSet | Get activity related to a particular role. | |
getID ( integer $activityID, boolean | string $dataSetType = false, array $options = [] ) : array | object | Get a particular activity record. | |
getNotifications ( integer $NotifyUserID, integer $Offset, integer $Limit = 30 ) : Gdn_DataSet | Get notifications for a user. | |
getNotificationsSince ( integer $UserID, integer $LastActivityID, array | string $FilterToActivityTypeIDs = '', integer $Limit = 5 ) : Gdn_DataSet | Get notifications for a user since designated ActivityID. | |
getPruneAfter ( ) : string | Get the delete after time. | |
getUsers ( &$Data ) | ||
getWhere ( array $Where = [], string $orderFields = '', string $orderDirection = '', integer | boolean $Limit = false, integer | boolean $Offset = false ) : Gdn_DataSet | Modifies standard Gdn_Model->GetWhere to use AcitivityQuery. | |
getWhereRecent ( array $where, integer $limit, integer $offset ) : Gdn_DataSet | Get the recent activities. | |
joinComments ( &$Activities ) | ||
joinUsers ( &$Activities ) | Join the users to the activities. | |
markRead ( $UserID ) | ||
mergeActivities ( $OldActivity, $NewActivity, array $Options = [] ) : array | ||
notificationPreference ( string $ActivityType, array $Preferences, string $Type = null ) : boolean | bool[] | Get default notification preference for an activity type. | |
queue ( array $Data, string | boolean $Preference = false, array $Options = [] ) | Queue an activity for saving later. | |
queueNotification ( integer $ActivityID, string $Story = '', string $Position = 'last', boolean $Force = false ) | Queue a notification for sending. | |
save ( array $Data, boolean $Preference = false, array $Options = [] ) : array | boolean | string | null | ||
saveQueue ( ) : array | ||
sendNotification ( integer $ActivityID, array | string $Story = '', boolean $Force = false ) | Send notification. | |
sendNotificationQueue ( ) | Send all notifications in the queue. | |
setNotified ( $ActivityIDs ) | ||
setPruneAfter ( string $pruneAfter ) : ActivityModel | Set the prune after date. | |
share ( &$Activity ) |
Method | Description | |
---|---|---|
_touch ( &$Data ) | ||
notifyWallComment ( array $Comment, $WallPost ) | Notify the user of wall comments. | |
notifyWallPost ( $WallPost ) |
Method | Description | |
---|---|---|
getEmailMessage ( array | object $activity ) : string | Takes an array representing an activity and builds the email message based on the activity's story and the contents of the global config Garden.Email.Prefix. | |
getPruneDate ( ) : DateTime | null | Get the exact timestamp to prune. | |
prune ( ) | Prune old activities. |
public activityQuery ( boolean $Join = true ) | ||
$Join | boolean |
public add ( integer $ActivityUserID, string $ActivityType, string $Story = null, integer | null $RegardingUserID = null, integer $CommentActivityID = null, string $Route = null, string | boolean $SendEmail = '' ) : integer | ||
$ActivityUserID | integer | |
$ActivityType | string | |
$Story | string | |
$RegardingUserID | integer | null | |
$CommentActivityID | integer | |
$Route | string | |
$SendEmail | string | boolean | |
return | integer | ActivityID of item created. |
public defineType ( string $Name, array $Activity = [] ) | ||
$Name | string | The string code of the activity type. |
$Activity | array | The data that goes in the ActivityType table. |
public deleteComment ( integer $ID ) : Gdn_DataSet | ||
$ID | integer | |
return | Gdn_DataSet |
public static getActivityType ( $ActivityType ) : boolean | ||
$ActivityType | ||
return | boolean |
public getByUser ( integer | boolean $NotifyUserID = false, integer $Offset, integer $Limit = 30 ) : Gdn_DataSet | ||
$NotifyUserID | integer | boolean | Unique ID of user to gather activity for or one of the NOTIFY_* constants in this class. |
$Offset | integer | Number to skip. |
$Limit | integer | How many to return. |
return | Gdn_DataSet | SQL results. |
public getComment ( integer $ID ) : array | false | ||
$ID | integer | |
return | array | false |
public getComments ( array $ActivityIDs ) : Gdn_DataSet | ||
$ActivityIDs | array | IDs of activity items. |
return | Gdn_DataSet | SQL results. |
public getNotificationsSince ( integer $UserID, integer $LastActivityID, array | string $FilterToActivityTypeIDs = '', integer $Limit = 5 ) : Gdn_DataSet | ||
$UserID | integer | Unique ID of user. |
$LastActivityID | integer | ID of activity to start at. |
$FilterToActivityTypeIDs | array | string | Limits returned activity to particular types. |
$Limit | integer | Max number to return. |
return | Gdn_DataSet | SQL results. |
public getPruneAfter ( ) : string | ||
return | string | Returns a string compatible with {@link strtotime()}. |
public getWhere ( array $Where = [], string $orderFields = '', string $orderDirection = '', integer | boolean $Limit = false, integer | boolean $Offset = false ) : Gdn_DataSet | ||
$Where | array | A filter suitable for passing to Gdn_SQLDriver::Where(). |
$orderFields | string | A comma delimited string to order the data. |
$orderDirection | string | One of **asc** or **desc**. |
$Limit | integer | boolean | The database limit. |
$Offset | integer | boolean | The database offset. |
return | Gdn_DataSet | SQL results. |
public static joinUsers ( &$Activities ) |
public mergeActivities ( $OldActivity, $NewActivity, array $Options = [] ) : array | ||
$OldActivity | ||
$NewActivity | ||
$Options | array | |
return | array |
public static notificationPreference ( string $ActivityType, array $Preferences, string $Type = null ) : boolean | bool[] | ||
$ActivityType | string | |
$Preferences | array | |
$Type | string | One of the following: - Popup: Popup a notification. - Email: Email the notification. - NULL: True if either notification is true. - both: Return an array of (Popup, Email). |
return | boolean | bool[] |
protected notifyWallComment ( array $Comment, $WallPost ) | ||
$Comment | array | |
$WallPost |
public sendNotificationQueue ( ) |
public setPruneAfter ( string $pruneAfter ) : ActivityModel | ||
$pruneAfter | string | A string compatible with {@link strtotime()}. Be sure to specify a negative string. |
return | ActivityModel | Returns `$this` for fluent calls. |
public static $MaxMergeCount |