*
* @see DB_DataObject
*/
-
-class Sitemap_notice_count extends Memcached_DataObject
+class Sitemap_notice_count extends Managed_DataObject
{
public $__table = 'sitemap_notice_count'; // table name
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
*
*
* @return array array of column definitions
*/
-
function table()
{
return array('notice_date' => DB_DATAOBJECT_DATE + DB_DATAOBJECT_NOTNULL,
*
* @return array key definitions
*/
-
function keys()
{
return array('notice_date' => 'K');
*
* @return array key definitions
*/
-
function keyTypes()
{
return $this->keys();
$noticeCounts = self::cacheGet('sitemap:notice:counts');
if ($noticeCounts === false) {
-
$snc = new Sitemap_notice_count();
$snc->orderBy('notice_date DESC');
$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);