my $invocant = shift;
my $self = '';
if (_check_params(@_) eq 1) {
- return -1;
+ return;
}
my $type = ref($invocant) || $invocant;
if (grep {$_ eq 'Labels'} @_) {
$sth->execute($opts{'layout_id'}, $opts{'creator'});
if ($sth->err) {
warn sprintf('Database returned the following error: %s', $sth->errstr);
- return -1;
+ return;
}
my $self = $sth->fetchrow_hashref;
bless ($self, $type);
warn sprintf('Database returned the following error on attempted DELETE: %s', $sth->errstr);
return -1;
}
+ return; # return no error code on success
}
sub save {
$sth->execute(@params);
if ($sth->err) {
warn sprintf('Database returned the following error: %s', $sth->errstr);
- return -1;
+ return;
}
return $self->{'layout_id'};
}
$sth->execute(@params);
if ($sth->err) {
warn sprintf('Database returned the following error: %s', $sth->errstr);
- return -1;
+ return;
}
my $sth1 = C4::Context->dbh->prepare("SELECT MAX(layout_id) FROM creator_layouts;");
$sth1->execute();
sub get_attr {
my $self = shift;
if (_check_params(@_) eq 1) {
- return -1;
+ return;
}
my ($attr) = @_;
if (exists($self->{$attr})) {
return $self->{$attr};
}
- else {
- return -1;
- }
return;
}
sub set_attr {
my $self = shift;
if (_check_params(@_) eq 1) {
- return -1;
+ return;
}
my %attrs = @_;
foreach my $attrib (keys(%attrs)) {
=head2 get_attr($attribute)
- Invoking the I<get_attr> method will return the value of the requested attribute or -1 on errors.
+ Invoking the I<get_attr> method will return the value of the requested attribute or undef on error.
example:
C<my $value = $layout->get_attr($attribute);>