Konstrukt
view release on metacpan or search on metacpan
lib/Konstrukt/Doc/Tutorial/Plugin/Note/DBI.pod view on Meta::CPAN
sub add_note {
my ($self, $text) = @_;
my $dbh = $Konstrukt::DBI->get_connection(@{$self->{db_settings}}) or return undef;
$text = $dbh->quote($text);
return $dbh->do("INSERT INTO note(text) VALUES($text)");
}
sub update_note {
my ($self, $id, $text) = @_;
my $dbh = $Konstrukt::DBI->get_connection(@{$self->{db_settings}}) or return undef;
$id = $dbh->quote($id);
$text = $dbh->quote($text);
return $dbh->do("UPDATE note SET text = $text WHERE id = $id");
}
sub delete_note {
lib/Konstrukt/Plugin/blog/DBI.pm view on Meta::CPAN
=item * $content - The entry's content
=item * $private - Is this entry only visible to the author?
=item * $update - Update the publication date to "now"
=back
=cut
sub update_entry {
my ($self, $id, $title, $description, $content, $private, $update) = @_;
my $dbh = $Konstrukt::DBI->get_connection(@{$self->{db_settings}}) or return undef;
#quoting
$title = $dbh->quote($title || '');
$description = $dbh->quote($description || '');
$content = $dbh->quote($content || '');
$private = $dbh->quote($private || 0);
lib/Konstrukt/Plugin/bookmarks/DBI.pm view on Meta::CPAN
=item * $title - The title of this bookmark
=item * $private - Is this entry only visible to me?
=item * $category - To which category does this entry belong?
=back
=cut
sub update_entry {
my ($self, $id, $url, $title, $private, $category) = @_;
my $dbh = $Konstrukt::DBI->get_connection(@{$self->{db_settings}}) or return undef;
#quoting
$title = $dbh->quote($title || '');
$url = $dbh->quote($url || '');
$private ||= 0;
$category ||= 0;
lib/Konstrukt/Plugin/bookmarks/DBI.pm view on Meta::CPAN
=item * $title - The new title
=item * $private - The new private flag
=item * $parent - To which parent category does this category belong?
=back
=cut
sub update_category {
my ($self, $id, $title, $private, $parent) = @_;
my $dbh = $Konstrukt::DBI->get_connection(@{$self->{db_settings}}) or return undef;
#quoting
$title = $dbh->quote($title || '');
#is this category private?
my $was_private = $self->get_category($id)->{private};
#prohibit a category to be set private, if it wasn't
lib/Konstrukt/Plugin/calendar/DBI.pm view on Meta::CPAN
=item * $end_hour, $end_minute - The ending time
=item * $description - What's this event about?
=item * $private - Is this entry only visible to the author?
=back
=cut
sub update_entry {
my ($self, $id, $year, $month, $day, $start_hour, $start_minute, $end_hour, $end_minute, $description, $private) = @_;
my $dbh = $Konstrukt::DBI->get_connection(@{$self->{db_settings}}) or return undef;
#quoting
$description = $dbh->quote($description || '');
$private ||= 0;
#update event
my $query = "UPDATE calendar_event SET date = '$year-$month-$day', start = '$start_hour:$start_minute', end = '$end_hour:$end_minute', description = $description, private = $private WHERE id = $id";
( run in 0.695 second using v1.01-cache-2.11-cpan-26ccb49234f )