Leser: 17
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
package My::DB::Object; use My::DB; use base qw(Rose::DB::Object); sub init_db { My::DB->new } __PACKAGE__->meta->column_type_class( 'sha256' => 'My::DB::Column::Sha256' ) 1; package My::DB::Column::Sha256; use strict; use Rose::DB::Object::Metadata::Column; our @ISA = qw(Rose::DB::Object::Metadata::Column); use Digest::SHA qw(sha256_hex); sub type { 'sha256' } sub format_value { my($self, $db, $value) = @_; return sha256_hex($value); } 1;