OSDN Git Service

add search by fb_post_id method
authorISHIKAWA Mutsumi <ishikawa@hanzubon.jp>
Fri, 2 Nov 2012 09:45:51 +0000 (18:45 +0900)
committerISHIKAWA Mutsumi <ishikawa@hanzubon.jp>
Fri, 2 Nov 2012 09:45:51 +0000 (18:45 +0900)
lib/Mubot4FB/DB.pm
lib/Mubot4FB/Queue/Client.pm [moved from lib/Mubot4FB/Queue.pm with 100% similarity]

index 7be7acd..664f4ea 100644 (file)
@@ -89,6 +89,18 @@ sub search_by_word {
        return $ret;
 }
 
+sub search_by_fb_post_id {
+       my ($me, $db_args) = @_;
+
+       my $sth = $me->{dbh}->prepare('select * from posts where fb_post_id = ?');
+       $sth->bind_param(1, $db_args->{fb_post_id}, SQL_BIGINT);
+       $sth->execute();
+       my $ret = $sth->fetchall_arrayref({});
+       $sth->finish;
+
+       return $ret;
+}
+
 sub search_lastpost_by_submitter {
        my ($me, $db_args) = @_;