DBIx-Class-CompressColumns

 view release on metacpan or  search on metacpan

lib/DBIx/Class/CompressColumns.pm  view on Meta::CPAN

        for my $col ( @{$self->compress_auto_columns} ) {
			$upd->{$col} = compress($upd->{$col},9) if ( exists $upd->{$col} );
        }
    }
    $self->next::method($upd, @rest);
}

=back

=head2 get_column

=cut

sub get_column {
    my ( $self, $column ) = @_;
    my $value = $self->next::method($column);

    if( defined $value ) {
		for my $col ( @{$self->compress_auto_columns} ) {
			if ( $column eq $col ) {
        		$value = $self->compress_auto ? uncompress( $value ) : $value;
			}
		}
    }

    return $value;
}

=head2 get_columns

=cut

sub get_columns {
    my $self = shift;
    my %data = $self->next::method(@_);

    foreach my $col (keys %data) {
        if(defined(my $value = $data{$col}) ) {
			for my $col2 ( @{$self->compress_auto_columns} ) {
				if ($col eq $col2) {
            		$value = $self->compress_auto ? uncompress( $value ) : $value;
            		$data{$col} = $value;
				}
			}
        }
    }

    return %data;
}

1;
__END__

=head1 SEE ALSO

L<DBIx::Class>,
L<Compress::Zlib>

=head1 AUTHOR

Jesse Stay (jessestay) <jesse@staynalive.com>

A Product of SocialToo.com

=head1 LICENSE

You may distribute this code under the same terms as Perl itself.



( run in 1.823 second using v1.01-cache-2.11-cpan-39bf76dae61 )