File: Index.pm

package info (click to toggle)
libdbix-class-schema-populatemore-perl 0.19-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 400 kB
  • sloc: perl: 3,412; makefile: 2
file content (49 lines) | stat: -rw-r--r-- 917 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package DBIx::Class::Schema::PopulateMore::Inflator::Index;

use Moo;
extends 'DBIx::Class::Schema::PopulateMore::Inflator';

=head1 NAME

DBIx::Class::Schema::PopulateMore::Inflator::Index - Coerce DateTime from Strings

=head1 DESCRIPTION

Allows you to make the value equal to the result object of a previously
inserted row.

=head1 ATTRIBUTES

This class defines the following attributes.

=head1 METHODS

This module defines the following methods.

=head2 inflate($command, $string)

This is called by Populate's dispatcher, when there is a match.

=cut

sub inflate
{ 
    my ($self, $command, $string) = @_;

    return $command->get_rs_index($string)
     || $command->exception_cb->("Bad Index in Fixture: $string");
}


=head1 AUTHOR

Please see L<DBIx::Class::Schema::PopulateMore> For authorship information

=head1 LICENSE

Please see L<DBIx::Class::Schema::PopulateMore> For licensing terms.

=cut


1;