]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Sitemap/Sitemap_notice_count.php
Updating all Memcached_DataObject extended classes to Managed_DataObject
[quix0rs-gnu-social.git] / plugins / Sitemap / Sitemap_notice_count.php
index 6e0061e97b083d5c07dd7ca7769f3a8e0fe49e06..cb42edcbf6ecc62c1efd64371c4715a1445aeb30 100644 (file)
@@ -51,8 +51,7 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
  *
  * @see      DB_DataObject
  */
-
-class Sitemap_notice_count extends Memcached_DataObject
+class Sitemap_notice_count extends Managed_DataObject
 {
     public $__table = 'sitemap_notice_count'; // table name
 
@@ -61,23 +60,6 @@ class Sitemap_notice_count extends Memcached_DataObject
     public $created;
     public $modified;
 
-    /**
-     * Get an instance by key
-     *
-     * This is a utility method to get a single instance with a given key value.
-     *
-     * @param string $k Key to use to lookup (usually 'notice_id' for this class)
-     * @param mixed  $v Value to lookup
-     *
-     * @return Sitemap_notice_count object found, or null for no hits
-     *
-     */
-
-    function staticGet($k, $v=null)
-    {
-        return Memcached_DataObject::staticGet('Sitemap_notice_count', $k, $v);
-    }
-
     /**
      * return table definition for DB_DataObject
      *
@@ -86,7 +68,6 @@ class Sitemap_notice_count extends Memcached_DataObject
      *
      * @return array array of column definitions
      */
-
     function table()
     {
         return array('notice_date' => DB_DATAOBJECT_DATE + DB_DATAOBJECT_NOTNULL,
@@ -103,7 +84,6 @@ class Sitemap_notice_count extends Memcached_DataObject
      *
      * @return array key definitions
      */
-
     function keys()
     {
         return array('notice_date' => 'K');
@@ -117,7 +97,6 @@ class Sitemap_notice_count extends Memcached_DataObject
      *
      * @return array key definitions
      */
-
     function keyTypes()
     {
         return $this->keys();
@@ -128,7 +107,6 @@ class Sitemap_notice_count extends Memcached_DataObject
         $noticeCounts = self::cacheGet('sitemap:notice:counts');
 
         if ($noticeCounts === false) {
-
             $snc = new Sitemap_notice_count();
             $snc->orderBy('notice_date DESC');
 
@@ -236,7 +214,8 @@ class Sitemap_notice_count extends Memcached_DataObject
         $snc = Sitemap_notice_count::staticGet('notice_date', DB_DataObject_Cast::date($d));
 
         if (empty($snc)) {
-            throw new Exception("No such registration date: $d");
+            // TRANS: Exception
+            throw new Exception(_m("No such registration date: $d."));
         }
 
         $orig = clone($snc);