2014-12-03 21:08:08 +01:00
|
|
|
<?php
|
|
|
|
namespace Framadate;
|
|
|
|
|
|
|
|
class Choice
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Name of the Choice
|
|
|
|
*/
|
|
|
|
private $name;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* All availables slots for this Choice.
|
|
|
|
*/
|
|
|
|
private $slots;
|
|
|
|
|
2014-12-06 19:42:01 +01:00
|
|
|
public function __construct($name='')
|
2014-12-03 21:08:08 +01:00
|
|
|
{
|
|
|
|
$this->name = $name;
|
|
|
|
$this->slots = array();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function addSlot($slot)
|
|
|
|
{
|
|
|
|
$this->slots[] = $slot;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getName()
|
|
|
|
{
|
|
|
|
return $this->name;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getSlots()
|
|
|
|
{
|
|
|
|
return $this->slots;
|
|
|
|
}
|
|
|
|
|
|
|
|
static function compare(Choice $a, Choice $b)
|
|
|
|
{
|
|
|
|
return strcmp($a->name, $b->name);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|