2014-12-03 21:08:08 +01:00
|
|
|
<?php
|
|
|
|
namespace Framadate;
|
|
|
|
|
|
|
|
class Form
|
|
|
|
{
|
|
|
|
|
|
|
|
public $titre;
|
|
|
|
public $commentaires;
|
|
|
|
public $nom;
|
|
|
|
public $adresse;
|
|
|
|
public $formatsondage;
|
|
|
|
public $champdatefin;
|
|
|
|
public $choix_sondage;
|
|
|
|
|
|
|
|
/**
|
2014-12-05 01:08:38 +01:00
|
|
|
* Tells if users can modify their choices.
|
2014-12-03 21:08:08 +01:00
|
|
|
*/
|
2014-12-05 01:08:38 +01:00
|
|
|
public $editable;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* If true, notify poll administrator when new vote is made.
|
|
|
|
*/
|
|
|
|
public $receiveNewVotes;
|
2014-12-03 21:08:08 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|