PHPackages                             wolnosciowiec/collective-voting-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. wolnosciowiec/collective-voting-bundle

AbandonedArchivedSymfony-bundle

wolnosciowiec/collective-voting-bundle
======================================

Symfony bundle that allows users to collective decide (direct democracy)

322PHP

Since Jul 23Pushed 8y ago2 watchersCompare

[ Source](https://github.com/Wolnosciowiec/CollectiveVotingBundle)[ Packagist](https://packagist.org/packages/wolnosciowiec/collective-voting-bundle)[ RSS](/packages/wolnosciowiec-collective-voting-bundle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Collective Voting Bundle
========================

[](#collective-voting-bundle)

Allows to create voting for an action, so every allowed person could vote on specific action.

There is a possibility to create multiple decision strategies, basing on known data like votes count and some minimum/maximum percentage of votes.

Creating a vote subject
=======================

[](#creating-a-vote-subject)

A subject must implement the `CollectiveVotingSubjectInterface`, so it could be just a class, or your entity that implements this interface.

Besides the subject class you would also need to create:

1. Factory (will be constructing subjects while having only the voting process object)
2. Processor (process the vote, if passed then for example publish the post)
3. Describer (describe how to display the object in the approval dashboard)

Step 1: Factory
===============

[](#step-1-factory)

You need to register a new factory class that will construct your subject objects.

Example service name: `collectivevoting.factory.appbundle.entity.content.page`Every service has to have the prefix of `collectivevoting.factory.`, the name is arbitrary.

If you will be using entity as a subject, then *there is a ready to use base class* for entities, so you don't have to implement it by your own.

```
