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