Changeset 75 in bookmarks for trunk/lib/Bookmarks.pm


Ignore:
Timestamp:
04/11/14 11:03:53 (10 years ago)
Author:
peter
Message:
  • added a collection attribute to the Bookmark class
  • added an update() method to the Bookmark class that calls the collection->update() method, if the collection is set
  • Bookmarks::Controller::update_and_redirect() calls Bookmark::update()
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Bookmarks.pm

    r72 r75  
    6767    return Bookmark->new({ 
    6868        %$bookmark, 
    69         exists   => 1, 
    70         tags     => [ $self->get_tags({ uri => $bookmark->{uri} }) ], 
    71         base_uri => $self->base_uri, 
     69        exists     => 1, 
     70        tags       => [ $self->get_tags({ uri => $bookmark->{uri} }) ], 
     71        base_uri   => $self->base_uri, 
     72        collection => $self, 
    7273    }); 
    7374} 
     
    110111        push @resources, Bookmark->new({ 
    111112            %$resource, 
    112             tags     => [ $self->get_tags({ uri => $resource->{uri} }) ], 
    113             base_uri => $self->base_uri, 
     113            exists     => 1, 
     114            tags       => [ $self->get_tags({ uri => $resource->{uri} }) ], 
     115            base_uri   => $self->base_uri, 
     116            collection => $self, 
    114117        }); 
    115118    } 
     
    184187    my $bookmark = shift; 
    185188 
     189    #TODO: accept a pre-made Bookmark object in addition to a hash 
    186190    my $uri = $bookmark->{uri}; 
    187191    my $title = $bookmark->{title}; 
Note: See TracChangeset for help on using the changeset viewer.