| 1 | package Rose::DB::Object::Metadata::Column::Enum; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | |||
| 5 | use Rose::DB::Object::Metadata::Column::Integer; | ||
| 6 | our @ISA = qw(Rose::DB::Object::Metadata::Column::Integer); | ||
| 7 | |||
| 8 | our $VERSION = '0.55'; | ||
| 9 | |||
| 10 | foreach my $type (__PACKAGE__->available_method_types) | ||
| 11 | { | ||
| 12 | __PACKAGE__->method_maker_type($type => 'enum'); | ||
| 13 | } | ||
| 14 | |||
| 15 | sub type { 'enum' } | ||
| 16 | |||
| 17 | *values = \&Rose::DB::Object::Metadata::Column::Scalar::check_in; | ||
| 18 | |||
| 19 | sub init_with_dbi_column_info | ||
| 20 | { | ||
| 21 | my($self, $col_info) = @_; | ||
| 22 | |||
| 23 | $self->SUPER::init_with_dbi_column_info($col_info); | ||
| 24 | |||
| 25 | if(ref $col_info->{'RDBO_ENUM_VALUES'}) | ||
| 26 | { | ||
| 27 | $self->values($col_info->{'RDBO_ENUM_VALUES'}); | ||
| 28 | } | ||
| 29 | |||
| 30 | return; | ||
| 31 | } | ||
| 32 | |||
| 33 | 1; | ||
| 34 | |||
| 35 | __END__ |