Summary
- File
- Package hierarchy PHPBoost\Event
- Class hierarchy \ContributionService
This service allows developers to manage their contributions.
This service allows developers to manage their contributions.
__static()
None found |
find_by_id(integer $id_contrib) : \Contribution
Finds a contribution with its identifier.
integer | $id_contrib | Id of the contribution. |
The contribution you wanted. If it doesn't exist, it will return null.
None found |
get_all_contributions(string $criteria = 'creation_date', string $order = 'desc') : array<mixed,\Contribution>
Gets all the contributions of the table. You can sort the list.
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. |
The list of the contributions.
None found |
find_by_criteria(string $module, integer $id_in_module = null, string $type = null, string $identifier = null, integer $poster_id = null, integer $fixer_id = null) : array<mixed,\Contribution>
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).
string | $module | The module identifier. |
integer | $id_in_module | The id in module field. |
string | $type | The contribution type. |
string | $identifier | The contribution identifier. |
integer | $poster_id | The poster. |
integer | $fixer_id | The fixer. |
The list of the contributions matching all the criterias.
None found |
save_contribution(\Contribution $contribution)
Create or update a contribution in the database.
\Contribution | $contribution | The contribution to synchronize with the data base. |
None found |
delete_contribution(\Contribution $contribution)
Deletes a contribution in the database.
\Contribution | $contribution | The contribution to delete in the data base. |
None found |
delete_contribution_module(string $module_id)
Delete all contributions of a module
string | $module_id | the module identifier |
None found |
generate_cache()
Generates the contribution cache file.
None found |
compute_number_contrib_for_each_profile() : array<mixed,integer>
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.
A map containing the values for each profile:
None found |