[Affelio-cvs 417] CVS update: affelio/lib/Affelio/SNS

Back to archive index

Tadashi Okoshi slash****@users*****
2005年 7月 1日 (金) 05:16:34 JST


Index: affelio/lib/Affelio/SNS/FriendManager.pm
diff -u affelio/lib/Affelio/SNS/FriendManager.pm:1.6 affelio/lib/Affelio/SNS/FriendManager.pm:1.7
--- affelio/lib/Affelio/SNS/FriendManager.pm:1.6	Thu Jun 30 02:00:05 2005
+++ affelio/lib/Affelio/SNS/FriendManager.pm	Fri Jul  1 05:16:33 2005
@@ -4,7 +4,7 @@
 #    http://affelio.jp/ (Japan)
 #    http://affelio.jp/ (USA and other area)
 #
-# $Id: FriendManager.pm,v 1.6 2005/06/29 17:00:05 slash5234 Exp $
+# $Id: FriendManager.pm,v 1.7 2005/06/30 20:16:33 slash5234 Exp $
 
 package Affelio::SNS::FriendManager;
 {
@@ -39,6 +39,53 @@
     }
     
     ########################################################################
+    #get_F1_count
+    ########################################################################
+    sub get_F1_count{
+	my $self = shift;
+	my $af = $self->{af};
+
+	##############################
+	#retrieve all friend records from DB
+	my $query = 'SELECT count(*) FROM AFuser_CORE_friends';
+	my $sth;
+	eval{
+	    $sth = $af->{db}->prepare($query);
+	    $sth->execute();
+	};
+	if($@){
+	    throw Affelio::exception::DBException($af->{db}->errstr);
+	}
+
+	my @row = $sth->fetchrow_array;
+	return($row[0]);
+    }
+
+    ########################################################################
+    #get_F2_count
+    ########################################################################
+    sub get_F2_count{
+	my $self = shift;
+	my $af = $self->{af};
+
+	##############################
+	#retrieve all friend records from DB
+	my $query = 'SELECT count(*) FROM AFuser_CORE_friendsfriends';
+	my $sth;
+	eval{
+	    $sth = $af->{db}->prepare($query);
+	    $sth->execute();
+	};
+	if($@){
+	    throw Affelio::exception::DBException($af->{db}->errstr);
+	}
+
+	my @row = $sth->fetchrow_array;
+	return($row[0]);
+    }
+
+
+    ########################################################################
     #add_friend
     ########################################################################
     sub add_friend{                  #returns uid (int)


Affelio-cvs メーリングリストの案内
Back to archive index