. */ /** * The application, representing an object in MySQL. */ require_once(FILESYSTEMROOTPATH."include/model/AbstractMySQL.php"); class Application extends AbstractMySQL { private $id; private $eventId; private $status; private $answerOne; private $answerTwo; private $answerThree; private $motivation; private $diet; private $visa; private $passportnumber; private $nationality; private $placeOfBirth; private $remarks; /** * Constructor */ public function __construct($data) { parent::__construct($data); if( is_array($data) ) { $this->eventId = $data['eventId']; $this->id = $data['id']; $this->status = $data['status']; $this->answerOne = $data['answerOne']; $this->answerTwo = $data['answerTwo']; $this->answerThree = $data['answerThree']; $this->motivation = $data['motivation']; $this->diet = $data['diet']; $this->visa = $data['visa']; $this->passportnumber = $data['passportNumber']; $this->nationality = $data['nationality']; $this->placeOfBirth = $data['placeOfBirth']; $this->remarks = $data['remarks']; }else { $this->eventId = ""; $this->id = ""; $this->status = ""; $this->answerOne = ""; $this->answerTwo = ""; $this->answerThree = ""; $this->motivation = ""; $this->diet = ""; $this->visa = ""; $this->passportnumber =""; $this->nationality = ""; $this->placeOfBirth = ""; $this->remarks = ""; } } /** * Destructor */ public function __destruct() { } /** * toString method */ public function __toString() { $r = "Id: ".$this->getId()."; "; $r .= "EventId: ".$this->getEventId()."; "; $r .= "Status: ".$this->getStatus()."."; $r .= "Answer one: ".$this->getAnswerOne()."."; $r .= "Answer two: ".$this->getAnswerTwo()."."; $r .= "Answer three: ".$this->getAnswerThree()."."; $r .= "Motivation: ".$this->getMotivation()."."; $r .= "Diet: ".$this->getDiet()."."; $r .= "Visa: ".$this->getVisa()."."; $r .= "Passportnumber: ".$this->getPassportnumber()."."; $r .= "Nationality: ".$this->getNationality()."."; $r .= "Place of birth: ".$this->getPlaceOfBirth()."."; $r .= "Remarks: ".$this->getRemarks()."."; return $r; } public function getId() { return $this->id; } public function setId($id) { $this->id = $id; } public function getStatus() { return $this->status; } public function setStatus($status){ $this->status=$status; } public function setAnswerOne($answerOne) { $this->answerOne = $answerOne; } public function getAnswerOne() { return $this->answerOne; } public function setAnswerThree($answerThree) { $this->answerThree = $answerThree; } public function getAnswerThree() { return $this->answerThree; } public function setAnswerTwo($answerTwo) { $this->answerTwo = $answerTwo; } public function getAnswerTwo() { return $this->answerTwo; } /** * Sets the diet. */ public function setDiet($diet) { $this->diet = $diet; } public function getDiet() { return $this->diet; } public function setEventId($eventId) { $this->eventId = $eventId; } public function getEventId() { return $this->eventId; } /** * Sets the motivation letter. * @param $motivation * @throws InvalidInputException when the motivation letter exceeds 1000 characters. */ public function setMotivation($motivation) { if(strlen($motivation)<=1000){ $this->motivation = $motivation; } else{ throw new InvalidInputException("The maximum length of the motivation letter is 1.000 characters."); } } public function getMotivation() { return $this->motivation; } public function setNationality($nationality) { $this->nationality = $nationality; } public function getNationality() { return $this->nationality; } public function setPassportnumber($passportnumber) { $this->passportnumber = $passportnumber; } public function getPassportnumber() { return $this->passportnumber; } public function setPlaceOfBirth($placeOfBirth) { $this->placeOfBirth = $placeOfBirth; } public function getPlaceOfBirth() { return $this->placeOfBirth; } public function setRemarks($remarks) { $this->remarks = $remarks; } public function getRemarks() { return $this->remarks; } public function setVisa($visa) { $this->visa=$visa; } public function getVisa() { return $this->visa; } }