2 DBIx::Class::InflateColumn::Object::Enum - Allows a DBIx::Class user to
3 define a Object::Enum column
9 Load this module via load_components and utilize is_enum and values
10 property to define Enumuration columns via Object::Enum
16 use base 'DBIx::Class';
18 __PACKAGE__->load_components(qw/InflateColumn::Object::Enum Core/);
19 __PACKAGE__->table('testtable');
20 __PACKAGE__->add_columns(
22 data_type => 'varchar',
25 list => [qw/red green blue/]
28 color_native => { # works inline with native enum type
32 list => [qw/red green blue/]
39 Now you may treat the column as an Object::Enum object.
41 my $table_rs = $db->resultset('TableClass')->create({
45 $table_rs->color->set_red; # sets color to red
46 $table_rs->color->is_red; # would return true
47 $table_rs->color->is_green; # would return false
48 print $table_rs->color->value; # would print 'red'
49 $table_rs->color->unset; # set the value to 'undef' or 'null'
50 $table_rs->color->is_red; # returns false now
54 Internal chained method with "register_column" in DBIx::Class::Row.
55 Users do not call this directly!
58 Jason M. Mills, "<jmmills at cpan.org>"
61 Please report any bugs or feature requests to
62 "bug-dbix-class-inflatecolumn-object-enum at rt.cpan.org", or through
64 <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=DBIx-Class-InflateColumn
65 -Object-Enum>. I will be notified, and then you'll automatically be
66 notified of progress on your bug as I make changes.
69 You can find documentation for this module with the perldoc command.
71 perldoc DBIx::Class::InflateColumn::Object::Enum
73 You can also look for information at:
75 * RT: CPAN's request tracker
76 <http://rt.cpan.org/NoAuth/Bugs.html?Dist=DBIx-Class-InflateColumn-O
79 * AnnoCPAN: Annotated CPAN documentation
80 <http://annocpan.org/dist/DBIx-Class-InflateColumn-Object-Enum>
83 <http://cpanratings.perl.org/d/DBIx-Class-InflateColumn-Object-Enum>
86 <http://search.cpan.org/dist/DBIx-Class-InflateColumn-Object-Enum>
89 Object::Enum, DBIx::Class, DBIx::Class::InflateColumn::URI
93 To install this module, run the following commands:
100 SUPPORT AND DOCUMENTATION
102 After installing, you can find documentation for this module with the
107 You can also look for information at:
109 RT, CPAN's request tracker
110 http://rt.cpan.org/NoAuth/Bugs.html?Dist=Foo
112 AnnoCPAN, Annotated CPAN documentation
113 http://annocpan.org/dist/Foo
116 http://cpanratings.perl.org/d/Foo
119 http://search.cpan.org/dist/Foo
122 COPYRIGHT AND LICENCE
124 Copyright (C) 2009 Jason M. Mills
126 This program is free software; you can redistribute it and/or modify it
127 under the same terms as Perl itself.