This repository has been archived on 2023-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
Foodloop-Server/lib/Pear/LocalLoop/Import/Role/ExternalName.pm

21 lines
372 B
Perl
Raw Permalink Normal View History

2019-07-02 14:21:01 +00:00
package Pear::LocalLoop::Import::Role::ExternalName;
use strict;
use warnings;
use Moo::Role;
requires qw/
external_name
schema
2021-03-20 12:09:50 +00:00
/;
2019-07-02 14:21:01 +00:00
has external_result => (
2021-03-20 12:09:50 +00:00
is => 'lazy',
builder => sub {
my $self = shift;
return $self->schema->resultset('ExternalReference')
->find_or_create( { name => $self->external_name } );
}
2019-07-02 14:21:01 +00:00
);
2019-07-05 14:30:31 +00:00
1;