Changeset 82 in bookmarks for trunk/TODO


Ignore:
Timestamp:
06/03/15 17:13:52 (9 years ago)
Author:
peter
Message:

issue #8: added notes about deleting bookmarks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/TODO

    r77 r82  
    1717    $ bkmk stop 
    1818    # stops the running server 
     19 
     20Deleting bookmarks 
     21 
     22    sub delete { 
     23        my $self = shift; 
     24        my $bookmark = shift; 
     25 
     26        my $sth_insert = $self->dbh->prepare('insert into deleted_bookmarks (id, dtime) values (?, ?)'); 
     27        $sth_insert->execute($bookmark->id, time); 
     28        my $sth_delete = $self->dbh->prepare('delete from bookmarks where id = ?'); 
     29        $sth_delete->execute($bookmark->id); 
     30    } 
     31 
     32Paging of results (will require counting bookmark total) 
     33 
     34    sub get_count { 
     35        my $self = shift; 
     36        my $search = shift; 
     37 
     38        my ($sql, @bind) = sql_interp( 
     39            'select count(*) from resources join bookmarks on resources.uri = bookmarks.uri', 
     40            $self->_sql_where_clause($search), 
     41        ); 
     42        my $sth = $self->dbh->prepare($sql); 
     43        $sth->execute(@bind); 
     44        my ($count) = $sth->fetchrow_array; 
     45        return $count; 
     46    } 
Note: See TracChangeset for help on using the changeset viewer.