function object_log_retrieve in Object Log 8
Same name and namespace in other branches
- 7 object_log.module \object_log_retrieve()
Retrieve an object row from the object log.
Parameters
$label: The label of an object to be retrieved.
Return value
The database row as a fetched object. $log->data contains the actual stored object.
1 call to object_log_retrieve()
- ObjectLogController::objectDetails in src/
Controller/ ObjectLogController.php - Display a stored object.
File
- ./
object_log.module, line 32
Code
function object_log_retrieve($label) {
$result = \Drupal::database()
->query('SELECT label, data, created FROM {object_log} WHERE label = :label', array(
':label' => $label,
));
$log = $result
->fetchObject();
if (empty($log->data)) {
return FALSE;
}
$log->data = unserialize($log->data);
return $log;
}