Persist specialstate.

This commit is contained in:
Martin Kamerbeek 2010-06-18 17:30:49 +02:00
parent 87163f5d0f
commit 81a937d90a
2 changed files with 35 additions and 0 deletions

View file

@ -22,6 +22,17 @@ sub addSpecialState {
my $self = shift;
my $state = shift || croak 'state is required';
my $id = shift;
my $db = $self->session->db;
$db->write( 'delete from users_specialState where userId=? and specialState=?', [
$self->getId,
$state,
] );
$db->write( 'insert into users_specialState (userId, specialState) values (?,?)', [
$self->getId,
$state,
] );
return;
}
@ -40,7 +51,13 @@ sub removeSpecialState {
my $self = shift;
my $state = shift || croak 'state is required';
my $id = shift;
my $db = $self->session->db;
$db->write( 'delete from users_specialState where userId=? and specialState=?', [
$self->getId,
$state,
] );
return;
}