/**
  * 
  * @return \models\UserAccountResetModel A single one or NULL. Technically it may load multiple ones, but we only return one.
  */
 public function loadRecentlyUnusedSentForUserAccountId($id, $seconds = 60)
 {
     global $DB;
     $stat = $DB->prepare("SELECT user_account_reset.* FROM user_account_reset WHERE reset_at IS NULL AND user_account_id =:user_account_id AND created_at > :since");
     $time = \TimeSource::getDateTime();
     $time->setTimestamp($time->getTimestamp() - $seconds);
     $stat->execute(array('user_account_id' => $id, 'since' => $time->format('Y-m-d H:i:s')));
     if ($stat->rowCount() > 0) {
         $uar = new UserAccountResetModel();
         $uar->setFromDataBaseRow($stat->fetch());
         return $uar;
     }
 }
 public function fetchAll()
 {
     $this->buildStart();
     $this->build();
     $this->buildStat();
     $results = array();
     while ($data = $this->stat->fetch()) {
         $uwgm = new UserAccountResetModel();
         $uwgm->setFromDataBaseRow($data);
         $results[] = $uwgm;
     }
     return $results;
 }