Commit | Line | Data |
75d07914 |
1 | package # hide from PAUSE |
c0e7b4e5 |
2 | DBIx::Class::CDBICompat::AttributeAPI; |
fe5d862b |
3 | |
bf5ecff9 |
4 | use strict; |
5 | use warnings; |
6 | |
fe5d862b |
7 | sub _attrs { |
8 | my ($self, @atts) = @_; |
9 | return @{$self->{_column_data}}{@atts}; |
10 | } |
11 | |
12 | *_attr = \&_attrs; |
13 | |
14 | sub _attribute_store { |
15 | my $self = shift; |
16 | my $vals = @_ == 1 ? shift: {@_}; |
8f7e9222 |
17 | $self->store_column($_, $vals->{$_}) for keys %{$vals}; |
fe5d862b |
18 | } |
19 | |
20 | sub _attribute_set { |
21 | my $self = shift; |
22 | my $vals = @_ == 1 ? shift: {@_}; |
23 | $self->set_column($_, $vals->{$_}) for keys %{$vals}; |
24 | } |
25 | |
26 | sub _attribute_delete { |
27 | my ($self, $attr) = @_; |
28 | delete $self->{_column_data}{$attr}; |
29 | } |
30 | |
31 | sub _attribute_exists { |
32 | my ($self, $attr) = @_; |
8f7e9222 |
33 | $self->has_column_loaded($attr); |
fe5d862b |
34 | } |
35 | |
36 | 1; |