rev 1409 - in trunk/siesta: bin lib/Siesta

[prev] [thread] [next] [lurker] [Date index for 2003/09/15]

From: richardc
Subject: rev 1409 - in trunk/siesta: bin lib/Siesta
Date: 20:18 on 15 Sep 2003
Author: richardc
Date: 2003-09-15 20:18:26 +0100 (Mon, 15 Sep 2003)
New Revision: 1409

Modified:
   trunk/siesta/bin/tequila
   trunk/siesta/lib/Siesta/DBI.pm
Log:
small bits of documentation

Modified: trunk/siesta/bin/tequila
===================================================================
--- trunk/siesta/bin/tequila	2003-09-15 19:18:05 UTC (rev 1408)
+++ trunk/siesta/bin/tequila	2003-09-15 19:18:26 UTC (rev 1409)
@@ -9,7 +9,7 @@
         shift;
         $Siesta::Config::CONFIG_FILE = shift;
     }
-} 
+}
 use Siesta::Config;
 
 umask 002;
@@ -25,9 +25,6 @@
     exit 20;
 }
 
-"0 but true";
-
-
 __END__
 
 =head1 NAME
@@ -68,3 +65,4 @@
 
 Distributed under the same terms as Perl itself.
 
+=cut

Modified: trunk/siesta/lib/Siesta/DBI.pm
===================================================================
--- trunk/siesta/lib/Siesta/DBI.pm	2003-09-15 19:18:05 UTC (rev 1408)
+++ trunk/siesta/lib/Siesta/DBI.pm	2003-09-15 19:18:26 UTC (rev 1409)
@@ -5,6 +5,37 @@
 __PACKAGE__->set_db( 'Main', @Siesta::Config::STORAGE );
 __PACKAGE__->mk_classdata('load_alias');
 
+=head1 NAME
+
+Siesta::DBI - base class extending Class::DBI
+
+=head1 DESCRIPTION
+
+most things in the system will be a subclass of Siesta::DBI, giving
+
+=head1 METHODS
+
+=head2 load_alias( $name )
+
+Sets the load_alias of a class to be $name.  This is used in
+conjunction with ->load to provide a shortcut to a serialised item.
+
+=head2 load( $id_or_name )
+
+Attempt to retrieve an object using either it's well-known name or the
+row id.
+
+It's used like so:
+
+ package User;
+ use base 'Siesta::DBI';
+ __PACKAGE__->load_alias( 'email' );
+
+ # time passes ...
+ my $user =  User->load( 'jay@xxxxxxxx.xxxxx.xxxx';
+
+=cut
+
 sub load {
     my $class = shift;
     my $id = shift;
@@ -16,6 +47,13 @@
     return $item;
 }
 
+
+=head1 init_db
+
+run the database creation script that lives in __DATA__
+
+=cut
+
 sub init_db {
     my $class = shift;
     my $dbh = $class->db_Main;

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