Class

UnreadContributionsCache

Package: PHPBoost\Cache Copyright: © 2005-2019 PHPBoost License: GNU/GPL-3.0 Author: Benoit SAUTEL ben.popeye@phpboost.com Version: PHPBoost 5.2 - last update: 2016 10 28 Since: PHPBoost 3.0 - 2009 11 10 Contributor: Julien BRISWALTER j1.seth@phpboost.com Contributor: Arnaud GENET elenwii@phpboost.com Located at: phpboost/cache/UnreadContributionsCache.class.php

This cache is used to know if there are unread contributions. If there are, it's able to tell us how much there are for the administrator, and for the other types of users, it's only able to tell if there are unread contributions.

UnreadContributionsCache implements CacheData
Methods summary
public
# synchronize( )

This method is called when the data needs to be sychronized. For instance,

public boolean
# are_there_unread_contributions( )

Tells whether there are unread contributions

public integer
# get_admin_unread_contributions_number( )

Tells how much contributions there are for administrators.

public
# set_admin_unread_contributions_number( integer $number )

Sets the number of unread contributions for the administrator. This method should be private but is public for unit tests.

public boolean
# have_moderators_unread_contributions( )

Tells whether moderators have unread contributions.

public boolean
# has_user_unread_contributions( integer $user_id )

Tells whether a user has unread contributions (it only deals with user-specific contributions and not with rank or group contributions).

public boolean
# has_group_unread_contributions( integer $group_id )

Tells whether a group has unread contributions (it only deals with user-specific contributions and not with rank or group contributions).

public
# set_moderators_have_unread_contributions( boolean $have )

Sets whether there are unread contributions for moderators. This method should be private but is public for unit tests.

public boolean
# have_members_unread_contributions( )

Tells whether members have unread contributions.

public
# set_members_have_unread_contributions( boolean $have )

Sets whether there are unread contributions for members. This method should be private but is public for unit tests.

public int[]
# get_groups_with_unread_contributions( )

Returns the list of the groups which have unread contributions.

public
# add_group_with_unread_contributions( integer $id )

Ass a group to the list of groups which have unread contributions. This method should be private but is public for unit tests.

public int[]
# get_users_with_unread_contributions( )

Returns the list of the users who have unread contributions.

public
# add_user_with_unread_contributions( integer $id )

Ass a group to the list of users who have unread contributions. This method should be private but is public for unit tests.

public
# set_values( array $numbers )

Sets the values from the method of ContributionService which returns the number of unread contributions for which profile.

public static UnreadContributionsCache
# load( )

Loads and returns the unread contribution cached data.

public static
# invalidate( )

Invalidates the current modules css files cached data.