resource_log_last_rows

Retrieve recent entries from the resource log

Variable Description Data type Default
$minref The minimum ref (id) of the log entry to retrieve integer 0
$days Number of recent days entries to return. Default = 7 (this is ignored if minref is supplied). integer 7
$maxrecords Maximum number of records to return. Default = all rows (0) integer 0
$field Limit results to particular metadata field IDs.  To filter by multiple fields use a CSV (e.g "8,73") string (empty)
$log_code Limit results to particluar log code(s) (see below). To filter by multiple codes use a CSV (e.g "x,X") string (empty)

Return values

Log entries in JSON format, including date, ref, resource, type (type of log entry), resource_type_field, user ID, notes, diff and usageoption value

ref

The ref value is the database table unique identifier for the log entry.

type

The type field records the type of log entry. The value is a log code, defined in ResourceSpace code base file include/definitions.php. Below are the possible values for the type field:

a --- LOG_CODE_ACCESS_CHANGED
b --- LOG_CODE_ALTERNATIVE_CREATED
c --- LOG_CODE_CREATED
C --- LOG_CODE_COPIED
d --- LOG_CODE_DOWNLOADED
e --- LOG_CODE_EDITED
E --- LOG_CODE_EMAILED
l --- LOG_CODE_LOGGED_IN
m --- LOG_CODE_MULTI_EDITED
N --- LOG_CODE_NODE_REVERT
o --- LOG_CODE_CREATED_BY_CHANGED
O --- LOG_CODE_USER_OPT_IN
p --- LOG_CODE_PAYED
r --- LOG_CODE_REVERTED_REUPLOADED
f --- LOG_CODE_REPLACED
R --- LOG_CODE_REORDERED
s --- LOG_CODE_STATUS_CHANGED
S --- LOG_CODE_SYSTEM
t --- LOG_CODE_TRANSFORMED
u --- LOG_CODE_UPLOADED
U --- LOG_CODE_UNSPECIFIED
v --- LOG_CODE_VIEWED
x --- LOG_CODE_DELETED
+ --- LOG_CODE_ENABLED
- --- LOG_CODE_DISABLED
X --- LOG_CODE_LOCKED
Y --- LOG_CODE_UNLOCKED
r --- LOG_CODE_COLLECTION_REMOVED_RESOURCE
R --- LOG_CODE_COLLECTION_REMOVED_ALL_RESOURCES
D --- LOG_CODE_COLLECTION_DELETED_ALL_RESOURCES
d --- LOG_CODE_COLLECTION_DELETED_RESOURCE
a --- LOG_CODE_COLLECTION_ADDED_RESOURCE
c --- LOG_CODE_COLLECTION_ADDED_RESOURCE_COPIED
m --- LOG_CODE_COLLECTION_ADDED_RESOURCE_COMMENT
* --- LOG_CODE_COLLECTION_ADDED_RESOURCE_RATING
S --- LOG_CODE_COLLECTION_SHARED_COLLECTION
E --- LOG_CODE_COLLECTION_EMAILED_COLLECTION
s --- LOG_CODE_COLLECTION_SHARED_RESOURCE_WITH
T --- LOG_CODE_COLLECTION_STOPPED_SHARING_COLLECTION
t --- LOG_CODE_COLLECTION_STOPPED_RESOURCE_ACCESS
X --- LOG_CODE_COLLECTION_DELETED_COLLECTION
b --- LOG_CODE_COLLECTION_BATCH_TRANSFORMED
A --- LOG_CODE_COLLECTION_ACCESS_CHANGED
Z --- LOG_CODE_COLLECTION_COLLECTION_DOWNLOADED