1DBIx::Class::Helper::RoUws:e:rPrCooxnDytBRrIeixsb:uu:ltCtelSdaestPsUe:pr:dlHaetDleop(ce3ur)m:e:nRtoawt:i:oPnroxyResultSetUpdate(3)
2
3
4
6 DBIx::Class::Helper::Row::ProxyResultSetUpdate - Efficiently reuse
7 ResultSet updates from results
8
10 ResultSet:
11
12 package MyApp::Schema::ResultSet::Foo;
13
14 use parent 'DBIx::Class::ResultSet';
15
16 sub update {
17 my ($self, $data) = @_;
18
19 die 'you fool!' if $data->{name} eq 'fool';
20
21 return $self->next::method($data);
22 }
23
24 Result:
25
26 package MyApp::Schema::Result::Foo;
27
28 use parent 'DBIx::Class::Core';
29
30 __PACKAGE__->load_components(qw( Helper::Row::ProxyResultSetUpdate ));
31
32 ...
33
34 or with DBIx::Class::Candy:
35
36 package MyApp::Schema::Result::Foo;
37
38 use DBIx::Class::Candy -components => ['Helper::Row::ProxyResultSetMethod'];
39
40 ...
41
43 This module makes reusing resultset updates from a result trivially
44 easy. Often the only way that people share update methods is by
45 overriding update in their resultset to use "update_all" in
46 DBIx::Class::ResultSet. Unfortunately, that can end up being wildly
47 inefficient. Instead, if you can write your update in terms of the
48 resultset, you can make your code much faster and more efficient.
49
51 Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com>
52
54 This software is copyright (c) 2020 by Arthur Axel "fREW" Schmidt.
55
56 This is free software; you can redistribute it and/or modify it under
57 the same terms as the Perl 5 programming language system itself.
58
59
60
61perl v5.32.1 DBIx:2:0C2l1a-s0s1:-:2H7elper::Row::ProxyResultSetUpdate(3)