date.chapril.org-framadate/app/classes/Framadate/Form.php
Olivier PEREZ fae91f6f3e Refactor poll creation
* Rename fields in Sondage table
* Add field "editable" which tells when users can edit their votes
* PDO : Configure 2 options (FETCH_OBJ + ERRMODE_EX)
* "formatsondage" does contains "+" (or not) anymore
2014-12-05 01:08:38 +01:00

58 lines
1002 B
PHP

<?php
namespace Framadate;
class Form
{
public $titre;
public $commentaires;
public $nom;
public $adresse;
public $formatsondage;
public $champdatefin;
public $choix_sondage;
/**
* Tells if users can modify their choices.
*/
public $editable;
/**
* If true, notify poll administrator when new vote is made.
*/
public $receiveNewVotes;
/**
* List of available choices
*/
private $choices;
public function __construct(){
$this->clearChoices();
}
public function clearChoices() {
$this->choices = array();
}
public function addChoice(Choice $choice)
{
$this->choices[] = $choice;
}
public function getChoices()
{
return $this->choices;
}
public function sortChoices()
{
usort($this->choices, array('Framadate\Choice', 'compare'));
}
public function lastChoice()
{
return end($this->choices);
}
}