events
Packages
Interfaces
Classes
Files

Class: ContributionService

Source Location: /events/contribution_service.class.php [line 39]

Class Overview


This service allows developers to manage their contributions.

Author(s):



Class Details

This service allows developers to manage their contributions.

Tags:

[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]


Class Methods

method delete_contribution [line 200]

void delete_contribution( &$contribution, Contribution $contribution)
Deletes a contribution in the database.

Parameters:

Contribution   $contribution   The contribution to delete in the data base.
   &$contribution  
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]

static method compute_number_contrib_for_each_profile [line 239]

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.

Tags:

  • return: A map containing the values for each profile:
    • r2 => for the administrator
    • r1 => for the moderators
    • r0 => for the members
    • gi => for the group whose id is i
    • mi => for the member whose id is i
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]

static method find_by_criteria [line 117]

static Contribution[] find_by_criteria( string $module, [int $id_in_module = null], [string $type = null], [string $identifier = null], [int $poster_id = null], [int $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).

Tags:

  • return: The list of the contributions matching all the criterias.

Parameters:

string   $module   The module identifier.
int   $id_in_module   The id in module field.
string   $type   The contribution type.
string   $identifier   The contribution identifier.
int   $poster_id   The poster.
int   $fixer_id   The fixer.
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]

static method find_by_id [line 47]

static Contribution find_by_id( int $id_contrib)
Finds a contribution with its identifier.

Tags:

  • return: The contribution you wanted. If it doesn't exist, it will return null.

Parameters:

int   $id_contrib   Id of the contribution.
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]

static method generate_cache [line 220]

static void generate_cache( )
Generates the contribution cache file.
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]

static method get_all_contributions [line 79]

static Contribution[] get_all_contributions( [string $criteria = 'creation_date'], [string $order = 'desc'])
Gets all the contributions of the table. You can sort the list.

Tags:

  • return: The list of the contributions.

Parameters:

string   $criteria   Criteria according to which they are ordered. It can be id, entitled, fixing_url, auth, current_status, module, creation_date, fixing_date, poster_id, fixer_id, poster_member.login poster_login, fixer_member.login fixer_login, identifier, id_in_module, type, description.
string   $order   desc or asc.
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]

static method save_contribution [line 167]

static void save_contribution( &$contribution, Contribution $contribution)
Create or update a contribution in the database.

Parameters:

Contribution   $contribution   The contribution to synchronize with the data base.
   &$contribution  
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]

Documentation generated on Tue, 28 Jul 2009 22:43:36 +0200 by phpDocumentor 1.4.1