1DBIx::Class::Helper::RoUws:e:rReCloanttiroinbDsuBhtIiexpd:D:WPCIelMra(ls3s)D:o:cHuemlepnetra:t:iRoonw::RelationshipDWIM(3)
2
3
4
6 DBIx::Class::Helper::Row::RelationshipDWIM - Type less for your
7 relationships!
8
10 Base clase:
11
12 package MyApp::Schema::Result;
13
14 use parent 'DBIx::Class::Core';
15
16 __PACKAGE__->load_components('Helper::Row::RelationshipDWIM');
17
18 sub default_result_namespace { 'MyApp::Schema::Result' }
19
20 1;
21
22 Result class:
23
24 package MyApp::Schema::Result::Foo;
25
26 use parent 'MyApp::Schema::Result';
27
28 # Define various class bits here
29
30 # succinct relationship definition yeah!
31
32 __PACKAGE__->has_many(friends => '::Person', 'foo_id');
33
34 # or with DBIx::Class::Candy:
35 has_many friends => '::Person', 'foo_id';
36
37 1;
38
40 This module prepends your "default_result_namespace" to related objects
41 if they begin with "::". Simple but handy.
42
44 Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com>
45
47 This software is copyright (c) 2020 by Arthur Axel "fREW" Schmidt.
48
49 This is free software; you can redistribute it and/or modify it under
50 the same terms as the Perl 5 programming language system itself.
51
52
53
54perl v5.32.0 D2B0I2x0:-:0C7l-a2s8s::Helper::Row::RelationshipDWIM(3)