Changeset 75 in bookmarks for trunk/lib/Bookmark.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/Bookmark.pm

    r70 r75  
    1717has bookmark_uri => ( is => 'rw' ); 
    1818has exists => ( is => 'ro' ); 
     19has collection => ( is => 'ro' ); 
    1920 
    2021sub created { scalar localtime $_[0]->ctime } 
     
    4445} 
    4546 
     47sub update { 
     48    my $self = shift; 
     49    die "Not part of a collection; nowhere to write this bookmark" unless $self->collection; 
     50    return $self->collection->update($self); 
     51} 
     52 
    4653# module return 
    47541; 
Note: See TracChangeset for help on using the changeset viewer.