[siesta-commit] siesta/lib/Siesta User.pm,1.9,1.10

[prev] [thread] [next] [lurker] [Date index for 2002/09/05]

From: muttley
Subject: [siesta-commit] siesta/lib/Siesta User.pm,1.9,1.10
Date: 14:03 on 05 Sep 2002
Update of /cvsroot/siesta/siesta/lib/Siesta
In directory usw-pr-cvs1:/tmp/cvs-serv22672/lib/Siesta

Modified Files:
	User.pm 
Log Message:
Added class methods for save and delete


Index: User.pm
===================================================================
RCS file: /cvsroot/siesta/siesta/lib/Siesta/User.pm,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- User.pm	5 Sep 2002 12:34:58 -0000	1.9
+++ User.pm	5 Sep 2002 13:03:21 -0000	1.10
@@ -20,6 +20,15 @@
 
 =head1 METHODS
 
+=head2 ->new 
+
+takes a user_id and retrieves the information from the database. 
+
+=head2 ->new_from_hash
+
+takes a hash (possible keys are the values of @Siesta::User::fields)
+and creates a new object.
+
 =head2 ->id
 
 get and set their id (usually their email address)
@@ -32,6 +41,15 @@
 
 get and set their surname
 
+
+=head2 ->save
+
+insert or update this object in the database.
+
+=head2 ->delete
+
+delete this object from the database.
+
 =head2 ->config 
 
 get and set config values for this User.
@@ -55,6 +73,17 @@
     my $hash    = shift;
 
     return bless $hash, $class;
+}
+
+
+sub save {
+	my $self = shift;
+	return Siesta->storage->save_user($self);
+}
+
+sub delete {
+	my $self = shift;
+	return Siesta->storage->delete_user($self)
 }
 
 1;



Generated at 13:57 on 01 Jul 2004 by mariachi 0.52