/**
  * Selects signupGadgets which are closed in a selected year
  */
 function selectSignupGadgetsByYear($year)
 {
     // TODO parameter check
     // clears the previous entry forms
     $this->removeAll();
     $sql = "SELECT id, opens, closes, title, description, eventdate, send_confirmation, confirmation_message " . "FROM ilmo_masiinat WHERE " . Database::isInYear($year, 'closes') . " ORDER BY id DESC";
     $result = $this->database->doSelectQuery($sql, array(), array());
     // Adds gadgets to signupGadgets variable
     while ($row = $result->fetchRow(MDB2_FETCHMODE_ASSOC)) {
         $singleGadget = new SignupGadget($row['id'], $row['title'], $row['description'], strtotime($row['eventdate']), strtotime($row['opens']), strtotime($row['closes']), CommonTools::sqlToBoolean($row['send_confirmation']), $row['confirmation_message']);
         array_push($this->signupGadgets, $singleGadget);
     }
 }