[Rt-commit] r3841 - in Jifty-DBI/trunk: . lib/Jifty/DBI

jesse at bestpractical.com jesse at bestpractical.com
Sun Sep 11 18:01:20 EDT 2005


Author: jesse
Date: Sun Sep 11 18:01:16 2005
New Revision: 3841

Added:
   Jifty-DBI/trunk/lib/Jifty/DBI/Column.pm
Modified:
   Jifty-DBI/trunk/   (props changed)
Log:
 r15679 at hualien:  jesse | 2005-09-10 22:44:32 -0400
 It's nice when I commit the new library too


Added: Jifty-DBI/trunk/lib/Jifty/DBI/Column.pm
==============================================================================
--- (empty file)
+++ Jifty-DBI/trunk/lib/Jifty/DBI/Column.pm	Sun Sep 11 18:01:16 2005
@@ -0,0 +1,47 @@
+use warnings;
+use strict;
+
+package Jifty::DBI::Column;
+
+use base qw/Class::Accessor/;
+
+__PACKAGE__->mk_accessors qw/name type default validator 
+    boolean 
+    readable writable 
+    length 
+    refers_to_collection_class
+    refers_to_record_class
+    alias_for_column 
+    /;
+
+=head1 NAME
+
+Jifty::DB::Column
+
+=head1 DESCRIPTION
+
+
+This class encapsulate's a single column in a Jifty::DBI::Record table description. It replaces the _accessible method in
+L<Jifty::DBI::Record>.
+
+It has the following accessors: C<name type default validator boolean refers_to readable writable length>.
+
+=cut
+
+
+sub new {
+    my $class = shift;
+    my $self = {};
+    bless $self => $class;
+    return $self;
+}
+
+sub is_numeric {
+    my $self = shift;
+    if ($self->type     =~ /INT|NUMERIC|DECIMAL|REAL|DOUBLE|FLOAT/i ) {
+        return 1;
+    }
+    return 0;
+
+}
+1;


More information about the Rt-commit mailing list