Methods summary
public static
|
|
public static
Contribution
|
#
find_by_id( integer $id_contrib )
Finds a contribution with its identifier.
Finds a contribution with its identifier.
Parameters
- $id_contrib
- Id of the contribution.
Returns
Contribution The contribution you wanted. If it doesn't exist, it will return null.
|
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.
Gets all the contributions of the table. You can sort the list.
Parameters
- $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.
- $order
- desc or asc.
Returns
|
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).
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).
Parameters
- $module
- The module identifier.
- $id_in_module
- The id in module field.
- $type
- The contribution type.
- $identifier
- The contribution identifier.
- $poster_id
- The poster.
- $fixer_id
- The fixer.
Returns
Contribution[] The list of the contributions matching all the criterias.
|
public static
|
#
save_contribution( Contribution $contribution )
Create or update a contribution in the database.
Create or update a contribution in the database.
Parameters
- $contribution
- The contribution to synchronize with the data base.
|
public static
|
#
delete_contribution( Contribution $contribution )
Deletes a contribution in the database.
Deletes a contribution in the database.
Parameters
- $contribution
- The contribution to delete in the data base.
|
public static
|
#
delete_contribution_module( string $module_id )
Delete all contributions of a module
Delete all contributions of a module
Parameters
- $module_id
- the module identifier
|
public static
|
#
generate_cache( )
Generates the contribution cache file.
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.
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.
Returns
int[] 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
|