use strict;
use warnings;
-use base qw/Class::Data::Inheritable/;
+use base qw/DBIx::Class/;
__PACKAGE__->mk_classdata('_temp_columns' => { });
$tmp{$_} = 1 for @cols;
$class->_temp_columns(\%tmp);
} else {
- return $class->NEXT::ACTUAL::_add_column_group($group, @cols);
+ return $class->next::method($group, @cols);
}
}
foreach my $key (keys %$attrs) {
$temp{$key} = delete $attrs->{$key} if $class->_temp_columns->{$key};
}
- my $new = $class->NEXT::ACTUAL::new($attrs, @rest);
+ my $new = $class->next::method($attrs, @rest);
foreach my $key (keys %temp) {
$new->set_temp($key, $temp{$key});
}
sub find_column {
my ($class, $col, @rest) = @_;
return $col if $class->_temp_columns->{$col};
- return $class->NEXT::ACTUAL::find_column($col, @rest);
+ return $class->next::method($col, @rest);
}
sub get_temp {
my ($self, $column) = @_;
- $self->throw( "Can't fetch data as class method" ) unless ref $self;
- $self->throw( "No such TEMP column '${column}'" ) unless $self->_temp_columns->{$column} ;
+ $self->throw_exception( "Can't fetch data as class method" ) unless ref $self;
+ $self->throw_exception( "No such TEMP column '${column}'" ) unless $self->_temp_columns->{$column} ;
return $self->{_temp_column_data}{$column}
if exists $self->{_temp_column_data}{$column};
return undef;
sub set_temp {
my ($self, $column, $value) = @_;
- $self->throw( "No such TEMP column '${column}'" )
+ $self->throw_exception( "No such TEMP column '${column}'" )
unless $self->_temp_columns->{$column};
- $self->throw( "set_temp called for ${column} without value" )
+ $self->throw_exception( "set_temp called for ${column} without value" )
if @_ < 3;
return $self->{_temp_column_data}{$column} = $value;
}