summaryrefslogtreecommitdiff
path: root/plugins/Sample/User_greeting_count.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-09-22 10:45:34 -0400
committerEvan Prodromou <evan@status.net>2010-09-22 10:45:34 -0400
commitb5cfcba4712809cb17eabba299ce5ff04f4d7d70 (patch)
tree38235bafd6ddf194e484b97321c0c341bea9de38 /plugins/Sample/User_greeting_count.php
parent91a186251047127ad7f1238f47ff761d9127627c (diff)
parentf0105893b0b78ff88d08cc2417773ad8a44dc2fa (diff)
Merge branch '0.9.x' into activityexport
Conflicts: plugins/OStatus/OStatusPlugin.php
Diffstat (limited to 'plugins/Sample/User_greeting_count.php')
-rw-r--r--plugins/Sample/User_greeting_count.php16
1 files changed, 6 insertions, 10 deletions
diff --git a/plugins/Sample/User_greeting_count.php b/plugins/Sample/User_greeting_count.php
index fc0cbd28f..38d68c91e 100644
--- a/plugins/Sample/User_greeting_count.php
+++ b/plugins/Sample/User_greeting_count.php
@@ -70,7 +70,6 @@ class User_greeting_count extends Memcached_DataObject
* @return User_greeting_count object found, or null for no hits
*
*/
-
function staticGet($k, $v=null)
{
return Memcached_DataObject::staticGet('User_greeting_count', $k, $v);
@@ -84,7 +83,6 @@ class User_greeting_count extends Memcached_DataObject
*
* @return array array of column definitions
*/
-
function table()
{
return array('user_id' => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL,
@@ -100,7 +98,6 @@ class User_greeting_count extends Memcached_DataObject
*
* @return array list of key field names
*/
-
function keys()
{
return array_keys($this->keyTypes());
@@ -118,7 +115,6 @@ class User_greeting_count extends Memcached_DataObject
* 'K' for primary key: for compound keys, add an entry for each component;
* 'U' for unique keys: compound keys are not well supported here.
*/
-
function keyTypes()
{
return array('user_id' => 'K');
@@ -134,7 +130,6 @@ class User_greeting_count extends Memcached_DataObject
*
* @return array magic three-false array that stops auto-incrementing.
*/
-
function sequenceKey()
{
return array(false, false, false);
@@ -150,7 +145,6 @@ class User_greeting_count extends Memcached_DataObject
*
* @return User_greeting_count instance for this user, with count already incremented.
*/
-
static function inc($user_id)
{
$gc = User_greeting_count::staticGet('user_id', $user_id);
@@ -165,12 +159,12 @@ class User_greeting_count extends Memcached_DataObject
$result = $gc->insert();
if (!$result) {
- throw Exception(sprintf(_m("Could not save new greeting count for %d"),
+ // TRANS: Exception thrown when the user greeting count could not be saved in the database.
+ // TRANS: %d is a user ID (number).
+ throw Exception(sprintf(_m("Could not save new greeting count for %d."),
$user_id));
}
-
} else {
-
$orig = clone($gc);
$gc->greeting_count++;
@@ -178,7 +172,9 @@ class User_greeting_count extends Memcached_DataObject
$result = $gc->update($orig);
if (!$result) {
- throw Exception(sprintf(_m("Could not increment greeting count for %d"),
+ // TRANS: Exception thrown when the user greeting count could not be saved in the database.
+ // TRANS: %d is a user ID (number).
+ throw Exception(sprintf(_m("Could not increment greeting count for %d."),
$user_id));
}
}