00001 <?php
00002
00003
00004
00005
00006
00007
00008 class DAOFormvalidations extends DataObjectBase {
00009 public $token;
00010 public $name;
00011 public $sessionid;
00012 public $expirationdate;
00013
00014 protected function create_table_object() {
00015 return new DBTable(
00016 'formvalidations',
00017 array(
00018 new DBFieldText('token', 35, null, DBField::NOT_NULL),
00019 new DBFieldText('name', 35, null, DBField::NOT_NULL),
00020 new DBFieldText('sessionid', 60, '', DBField::NONE),
00021 new DBFieldDateTime('expirationdate', null, DBField::NOT_NULL),
00022 ),
00023 array('token', 'name')
00024 );
00025 }
00026
00027 public function is_valid_for_at_least($minutes) {
00028 return $this->expirationdate > (time() + $minutes * 60);
00029 }
00030 }