Sweden Democrats' Meeting Tool
 All Classes Files Functions Variables Pages
Public Member Functions | Public Attributes | List of all members
SD_Meeting_Tool_Election Class Reference

Election class. More...

Public Member Functions

 __construct ()
 is_anonymous ()
 Returns whether this is an anonymous election.
 is_manual ()
 Returns whether this is a manual election.
 is_open ()
 Returns whether this is an open election.
 clear_electoral_register ()
 Clears the electoral register and everything related to it.
 electoral_register_calculated ($when)
 has_electoral_register ()
 is_electoral_register_calculated ()
 Returns whether the electoral register has been calculated.
 begin_registration ()
 Marks the election as being in status "registering".
 finish ()
 Marks the election as finished.
 is_editing ()
 Return whether the election is being edited.
 is_finished ()
 Return whether the election is finished.
 is_registering ()
 Return whether the election is collecting votes.
 finished_editing ()
 A very primitive check that the election has been somewhat edited and ready to go to the next status.
 lists ()
 Returns a array of the list id's that this election uses.

Public Attributes

 $id
 $data

Detailed Description

Election class.

See Also
SD_Meeting_Tool_Elections
Author
Edward Plainview edwar.nosp@m.d.pl.nosp@m.ainvi.nosp@m.ew@s.nosp@m.verig.nosp@m.edem.nosp@m.okrat.nosp@m.erna.nosp@m..se

Constructor & Destructor Documentation

SD_Meeting_Tool_Election::__construct ( )

Member Function Documentation

SD_Meeting_Tool_Election::begin_registration ( )

Marks the election as being in status "registering".

SD_Meeting_Tool_Election::clear_electoral_register ( )

Clears the electoral register and everything related to it.

SD_Meeting_Tool_Election::electoral_register_calculated (   $when)

Sets when the electoral register was last calculated.

Parameters
$whenUnix time when the register was calculated.
SD_Meeting_Tool_Election::finish ( )

Marks the election as finished.

SD_Meeting_Tool_Election::finished_editing ( )

A very primitive check that the election has been somewhat edited and ready to go to the next status.

Basically only checks that the lists are set and that there are more than 0 options.

Returns
True if the election passes simple checks to go to the next status.
SD_Meeting_Tool_Election::has_electoral_register ( )

Does this election have an electoral register?

Returns
True, if this election has an electoral register.
SD_Meeting_Tool_Election::is_anonymous ( )

Returns whether this is an anonymous election.

Returns
True, if this election is anonymous.
SD_Meeting_Tool_Election::is_editing ( )

Return whether the election is being edited.

Returns
True if election is in editing status.
SD_Meeting_Tool_Election::is_electoral_register_calculated ( )

Returns whether the electoral register has been calculated.

Returns
True if the electoral register has been calculated. Will always return true if the election is manual.
SD_Meeting_Tool_Election::is_finished ( )

Return whether the election is finished.

Returns
True if election is finished.
SD_Meeting_Tool_Election::is_manual ( )

Returns whether this is a manual election.

Returns
True, if this election is manual.
SD_Meeting_Tool_Election::is_open ( )

Returns whether this is an open election.

Returns
True, if this election is open.
SD_Meeting_Tool_Election::is_registering ( )

Return whether the election is collecting votes.

Returns
True if election is in collection status.
SD_Meeting_Tool_Election::lists ( )

Returns a array of the list id's that this election uses.

Returns
An array of list id's that this election uses.

Member Data Documentation

SD_Meeting_Tool_Election::$data

Serialized data.

Only this property will be saved to the DB.

Contains:

  • eligible_voters List ID of eligible voters.
  • electoral_register_calculated True if the electoral register has been calculated.
  • group_field Which of the participants field to use as a group.
  • groups_complete Array of group => $group that have filled their voter quotas.
  • groups_incomplete Array of group => voter_count of groups that have not filled their voter quotas (too few voters).
  • have_voted List ID of voters that have voted.
  • may_vote List ID of voters that may vote.
  • name Name of election.
  • options Array of SD_Meeting_Tool_Election_Choices for which the voters can ... vote.
  • status String status of the election: 'editing', 'registering', 'finished'.
  • type The type of the election: manual, open, anonymous.
  • voters_present List ID of voters that are present and able to vote.
  • voting_order_field Which participant field name specifies the order in which parts are allowed to vote.
SD_Meeting_Tool_Election::$id

ID of election.


The documentation for this class was generated from the following file: