Changeset 71 in bookmarks for trunk/lib/Bookmarks/List.pm


Ignore:
Timestamp:
02/13/14 16:10:42 (10 years ago)
Author:
peter
Message:
  • added a Bookmarks::Search class that encapsulates the query, tags, limit, and offset values for a given search
  • Bookmarks::List now has a search attribute that takes a Bookmarks::Search object instead of the individual attributes from the search
  • Bookmarks::get_cotags() takes a Bookmarks::Search object as its search parameter instead of discrete tags and query parameters
  • changed the name of the Bookmarks::get_bookmarks() parameter from tag to tags to align with the rest of the backend APIs
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Bookmarks/List.pm

    r70 r71  
    66use HTTP::Date qw{time2iso time2isoz}; 
    77 
    8 has bookmarks => (is => 'ro'); 
    9 has query  => (is => 'ro'); 
    10 has tags   => ( 
     8has bookmarks => ( 
    119    is => 'ro', 
    12     default => sub { [] }, 
     10    isa => 'Bookmarks', 
    1311); 
    14 has limit  => (is => 'ro'); 
    15 has offset => (is => 'ro'); 
     12has search => ( 
     13    is => 'ro', 
     14    isa => 'Bookmarks::Search', 
     15    handles => [qw{query tags limit offset}], 
     16); 
    1617has results => ( is => 'ro' ); 
    1718has title => ( 
     
    182183 
    183184    my @all_tags = $self->bookmarks->get_tags({ selected => @{ $self->tags }[0] }); 
    184     my @cotags = $self->bookmarks->get_cotags({ 
    185         query  => $self->query, 
    186         tag    => $self->tags, 
    187     }); 
     185    my @cotags = $self->bookmarks->get_cotags({ search => $self->search }); 
    188186 
    189187    $template->process( 
Note: See TracChangeset for help on using the changeset viewer.