if ( is_null( $categoryTitle ) )
$this->dieUsage("Category name $category is not valid", 'param_category');
- $prop = array_flip($params['prop']);
+ $prop = array_flip($params['prop']);
$fld_ids = isset($prop['ids']);
$fld_title = isset($prop['title']);
$fld_sortkey = isset($prop['sortkey']);
+ $fld_timestamp = isset($prop['timestamp']);
if (is_null($resultPageSet)) {
$this->addFields(array('cl_from', 'cl_sortkey', 'page_namespace', 'page_title'));
$this->addFields($resultPageSet->getPageTableFields()); // will include page_ id, ns, title
$this->addFields(array('cl_from', 'cl_sortkey'));
}
-
+
+ $this->addFieldsIf('cl_timestamp', $fld_timestamp);
$this->addTables(array('page','categorylinks')); // must be in this order for 'USE INDEX'
$this->addOption('USE INDEX', 'cl_sortkey'); // Not needed after bug 10280 is applied to servers
$this->addWhereFld('cl_to', $categoryTitle->getDBkey());
$this->addWhereFld('page_namespace', $params['namespace']);
$this->addOption('ORDER BY', "cl_to, cl_sortkey, cl_from");
-
+
$limit = $params['limit'];
$this->addOption('LIMIT', $limit +1);
}
if ($fld_sortkey)
$vals['sortkey'] = $row->cl_sortkey;
+ if ($fld_timestamp)
+ $vals['timestamp'] = wfTimestamp(TS_ISO_8601, $row->cl_timestamp);
$data[] = $vals;
} else {
$resultPageSet->processDbRow($row);
if ($from != 0) {
// Duplicate sort key continue
- $this->addWhere( "cl_sortkey>$sortKey OR (cl_sortkey=$sortKey AND cl_from>=$from)" );
+ $this->addWhere( "cl_sortkey>$sortKey OR (cl_sortkey=$sortKey AND cl_from>=$from)" );
} else {
- $this->addWhere( "cl_sortkey>=$sortKey" );
+ $this->addWhere( "cl_sortkey>=$sortKey" );
}
}
'category' => null,
'prop' => array (
ApiBase :: PARAM_DFLT => 'ids|title',
- ApiBase :: PARAM_ISMULTI => true,
+ ApiBase :: PARAM_ISMULTI => true,
ApiBase :: PARAM_TYPE => array (
'ids',
'title',
'sortkey',
+ 'timestamp',
)
),
'namespace' => array (
- ApiBase :: PARAM_ISMULTI => true,
+ ApiBase :: PARAM_ISMULTI => true,
ApiBase :: PARAM_TYPE => 'namespace',
),
'continue' => null,