19 lines
334 B
Perl
19 lines
334 B
Perl
|
package Pear::LocalLoop::Import::Role::ExternalName;
|
||
|
use strict;
|
||
|
use warnings;
|
||
|
use Moo::Role;
|
||
|
|
||
|
requires qw/
|
||
|
external_name
|
||
|
schema
|
||
|
/;
|
||
|
|
||
|
has external_result => (
|
||
|
is => 'lazy',
|
||
|
builder => sub {
|
||
|
my $self = shift;
|
||
|
return $self->resultset('ExternalReference')->find_or_create({ name => $self->external_name });
|
||
|
}
|
||
|
);
|
||
|
|
||
|
1;
|