Show
Ignore:
Timestamp:
05/18/06 16:58:46 (6 years ago)
Author:
nick
Message:

Move some common change fetching code into the parent

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • wiki-toolkit/trunk/lib/Wiki/Toolkit/Feed/Listing.pm

    r292 r295  
    1212=cut 
    1313 
     14 
     15=item B<fetch_recently_changed_nodes> 
     16 
     17Based on the supplied criteria, fetch a list of the recently changed nodes 
     18 
     19=cut 
     20sub fetch_recently_changed_nodes { 
     21    my ($self, %args) = @_; 
     22 
     23    my $wiki = $self->{wiki}; 
     24 
     25    my %criteria = ( 
     26                   ignore_case => 1, 
     27                   ); 
     28 
     29    # If we're not passed any parameters to limit the items returned,  
     30    #  default to 15. 
     31    $args{days} ? $criteria{days}           = $args{days} 
     32                : $criteria{last_n_changes} = $args{items} || 15; 
     33   
     34    $criteria{metadata_wasnt} = { major_change => 0 }     if $args{ignore_minor_edits}; 
     35    $criteria{metadata_was}   = $args{filter_on_metadata} if $args{filter_on_metadata}; 
     36 
     37    my @changes = $wiki->list_recent_changes(%criteria); 
     38 
     39    return @changes; 
     40} 
     41 
     42=item B<fetch_oldest_for_recently_changed> 
     43 
     44Based on the supplied criteria (but not using all of those used by 
     45B<fetch_recently_changed_nodes>), find the oldest node from the recently 
     46changed nodes set. Normally used for dating the whole of a Feed. 
     47 
     48=cut 
     49 
    14501;