Class

ContributionService

Package: PHPBoost\Event Copyright: © 2005-2019 PHPBoost License: GNU/GPL-3.0 Author: Benoit SAUTEL ben.popeye@phpboost.com Version: PHPBoost 5.2 - last update: 2016 10 30 Since: PHPBoost 2.0 - 2008 07 21 Contributor: Arnaud GENET elenwii@phpboost.com Contributor: Julien BRISWALTER j1.seth@phpboost.com Located at: phpboost/event/ContributionService.class.php

This service allows developers to manage their contributions.

Methods summary
public static
# __static( )
public static Contribution
# find_by_id( integer $id_contrib )

Finds a contribution with its identifier.

public static Contribution[]
# get_all_contributions( string $criteria = 'creation_date', string $order = 'desc' )

Gets all the contributions of the table. You can sort the list.

public static Contribution[]
# find_by_criteria( string $module, integer $id_in_module = null, string $type = null, string $identifier = null, integer $poster_id = null, integer $fixer_id = null )

Builds a list of the contributions matching the required criteria(s). All the parameters represent the criterias you can use. If you don't want to use a criteria, let the null value. The returned contribution match all the criterias (it's a AND condition).

public static
# save_contribution( Contribution $contribution )

Create or update a contribution in the database.

public static
# delete_contribution( Contribution $contribution )

Deletes a contribution in the database.

public static
# delete_contribution_module( string $module_id )

Delete all contributions of a module

public static
# generate_cache( )

Generates the contribution cache file.

public static int[]
# compute_number_contrib_for_each_profile( )

Computes the number of contributions available for each profile. It will count the contributions for the administrator, the moderators, the members, for each group and for each member who can have some special authorizations.

Constants summary
integer CONTRIBUTION_TYPE
# 0