Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision e6535205

Von Moritz Bunkus vor fast 12 Jahren hinzugefügt

  • ID e6535205268abb2fe58855f627a41ae389e7c509
  • Vorgänger 3dee3e56
  • Nachfolger 4d9d7d51

ActsAsList-Helfer: get_full_list() liefert alle Items in der selben Liste wie $self

Unterschiede anzeigen:

SL/DB/Helper/ActsAsList.pm
use parent qw(Exporter);
our @EXPORT = qw(move_position_up move_position_down add_to_list remove_from_list reorder_list configure_acts_as_list
get_previous_in_list get_next_in_list);
get_previous_in_list get_next_in_list get_full_list);
use Carp;
......
return get_previous_or_next($self, 'previous');
}
sub get_full_list {
my ($self) = @_;
my $group_by = get_spec(ref $self, 'group_by') || [];
$group_by = [ $group_by ] if $group_by && !ref $group_by;
my @where = map { ($_ => $self->$_) } @{ $group_by };
return $self->_get_manager_class->get_all(where => \@where, sort_by => column_name($self) . ' ASC');
}
sub reorder_list {
my ($class_or_self, @ids) = @_;
......
Fetches the next item in the list. Returns C<undef> if C<$self> is
already the last one.
=item C<get_full_list>
Fetches all items in the same list as C<$self> and returns them as an
array reference.
=item C<reorder_list @ids>
Re-orders the objects given in C<@ids> by their position in C<@ids> by

Auch abrufbar als: Unified diff