Esempio n. 1
0
 /**
  * @param $id
  * @param $status
  * @param $surveyName
  * @param $created
  * @param $description
  */
 function __construct($id, SurveyStatus $status, $surveyName, $created, $description)
 {
     $this->created = $created;
     $this->description = $description;
     $this->id = $id;
     $this->status = $status->getName();
     $this->surveyName = $surveyName;
     $this->action = '<a href="report.php?id=' . $id . '">View Report</a>';
     if ($status->getValue() == SurveyStatus::active) {
         $sid = SurveyStatus::disabled;
         $this->action .= " | <a href=\"changeStatus.php?id={$id}&status={$sid}\">Disable</a>";
     } else {
         $sid = SurveyStatus::active;
         $this->action .= " | <a href=\"changeStatus.php?id={$id}&status={$sid}\">Enable</a>";
     }
 }
Esempio n. 2
0
 public function getName()
 {
     foreach (SurveyStatus::toArray() as $key => $val) {
         if ($this->value == $val) {
             return $key;
         }
     }
     return $this->getValue();
 }
Esempio n. 3
0
 /**
  * @param SurveyStatus $status
  */
 public function setStatus(SurveyStatus $status)
 {
     $this->status = $status->getValue();
 }