[system] / trunk / webwork-modperl / lib / WeBWorK / DB / Schema / Null.pm Repository:
ViewVC logotype

View of /trunk/webwork-modperl/lib/WeBWorK/DB/Schema/Null.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 808 - (download) (as text) (annotate)
Thu Apr 17 21:01:17 2003 UTC (10 years, 1 month ago) by sh002i
File size: 1695 byte(s)
Lots of work on WWDBv2... WW1Hash is done! A complete dbLayout (as
detailed on global.conf.dist) works now.
-sam

    1 ################################################################################
    2 # WeBWorK mod_perl (c) 2000-2002 WeBWorK Project
    3 # $Id$
    4 ################################################################################
    5 
    6 package WeBWorK::DB::Schema::Null;
    7 
    8 =head1 NAME
    9 
   10 WeBWorK::DB::Schema::Null - a dummy schema with no backend.
   11 
   12 =cut
   13 
   14 use strict;
   15 use warnings;
   16 
   17 use constant TABLES => qw(password permission key user set set_user problem problem_user);
   18 use constant STYLE  => "dummy";
   19 
   20 ################################################################################
   21 # static functions
   22 ################################################################################
   23 
   24 sub tables() {
   25   return TABLES;
   26 }
   27 
   28 sub style() {
   29   return STYLE;
   30 }
   31 
   32 ################################################################################
   33 # constructor
   34 ################################################################################
   35 
   36 sub new($$$$$) {
   37   my ($proto, $driver, $table, $record, $params) = @_;
   38   my $class = ref($proto) || $proto;
   39   die "$table: unsupported table"
   40     unless grep { $_ eq $table } $proto->tables();
   41   die $driver->style(), ": style mismatch"
   42     unless $driver->style() eq $proto->style();
   43   my $self = {
   44     driver => $driver,
   45     table  => $table,
   46     record => $record,
   47     params => $params,
   48   };
   49   bless $self, $class;
   50   return $self;
   51 }
   52 
   53 ################################################################################
   54 # table access functions
   55 ################################################################################
   56 
   57 sub list   { return ();    }
   58 sub exists { return 1;     }
   59 sub add    { return 0;     }
   60 sub get    { return undef; }
   61 sub put    { return 0;     }
   62 sub delete { return 1;     }
   63 
   64 1;

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9