Perl x Open Food Facts Hackathon: Paris, France - May 24-25 Learn more

use strict;
use Mouse;
our $VERSION = '1.9.99_2.0alpha1';
sub import {
if ( $_[1] eq 'XML' ) {
'Lemonldap::NG::Common::Module';
}
else {
'Lemonldap::NG::Common::Module';
}
}
has notifField => (
is => 'rw',
builder => sub {
my $uid =
$_[0]->conf->{notificationField}
|| $_[0]->conf->{whatToTrace}
|| 'uid';
$uid =~ s/^\$//;
return $uid;
}
);
sub getNotifications {
my ( $self, $uid ) = @_;
my $forUser = $self->get($uid);
my $forAll = $self->get( $self->conf->{notificationWildcard} );
if ( $forUser and $forAll ) {
return { %$forUser, %$forAll };
}
else {
return ( ( $forUser ? $forUser : $forAll ), $forUser );
}
}
1;