2015-08-17 17:00:26 -07:00
< ? php
/**
* @ file
* Provide views data for dblog . module .
*/
/**
* Implements hook_views_data () .
*/
function dblog_views_data () {
2017-04-13 15:53:35 +01:00
$data = [];
2015-08-17 17:00:26 -07:00
$data [ 'watchdog' ][ 'table' ][ 'group' ] = t ( 'Watchdog' );
$data [ 'watchdog' ][ 'table' ][ 'wizard_id' ] = 'watchdog' ;
2017-04-13 15:53:35 +01:00
$data [ 'watchdog' ][ 'table' ][ 'base' ] = [
2015-08-17 17:00:26 -07:00
'field' => 'wid' ,
'title' => t ( 'Log entries' ),
'help' => t ( 'Contains a list of log entries.' ),
2017-04-13 15:53:35 +01:00
];
2015-08-17 17:00:26 -07:00
2017-04-13 15:53:35 +01:00
$data [ 'watchdog' ][ 'wid' ] = [
2015-08-17 17:00:26 -07:00
'title' => t ( 'WID' ),
'help' => t ( 'Unique watchdog event ID.' ),
2017-04-13 15:53:35 +01:00
'field' => [
2018-11-23 12:29:20 +00:00
'id' => 'standard' ,
2017-04-13 15:53:35 +01:00
],
'filter' => [
2015-08-17 17:00:26 -07:00
'id' => 'numeric' ,
2017-04-13 15:53:35 +01:00
],
'argument' => [
2015-08-17 17:00:26 -07:00
'id' => 'numeric' ,
2017-04-13 15:53:35 +01:00
],
'sort' => [
2015-08-17 17:00:26 -07:00
'id' => 'standard' ,
2017-04-13 15:53:35 +01:00
],
];
2015-08-17 17:00:26 -07:00
2017-04-13 15:53:35 +01:00
$data [ 'watchdog' ][ 'uid' ] = [
2015-08-17 17:00:26 -07:00
'title' => t ( 'UID' ),
2018-11-23 12:29:20 +00:00
'help' => t ( 'The user ID of the user on which the log entry was written.' ),
2017-04-13 15:53:35 +01:00
'field' => [
2018-11-23 12:29:20 +00:00
'id' => 'standard' ,
2017-04-13 15:53:35 +01:00
],
'filter' => [
2015-08-17 17:00:26 -07:00
'id' => 'numeric' ,
2017-04-13 15:53:35 +01:00
],
'argument' => [
2015-08-17 17:00:26 -07:00
'id' => 'numeric' ,
2017-04-13 15:53:35 +01:00
],
'relationship' => [
2015-08-17 17:00:26 -07:00
'title' => t ( 'User' ),
'help' => t ( 'The user on which the log entry as written.' ),
2018-11-23 12:29:20 +00:00
'base' => 'users_field_data' ,
2015-08-17 17:00:26 -07:00
'base field' => 'uid' ,
'id' => 'standard' ,
2017-04-13 15:53:35 +01:00
],
];
2015-08-17 17:00:26 -07:00
2017-04-13 15:53:35 +01:00
$data [ 'watchdog' ][ 'type' ] = [
2015-08-17 17:00:26 -07:00
'title' => t ( 'Type' ),
2016-04-20 09:56:34 -07:00
'help' => t ( 'The type of the log entry, for example "user" or "page not found".' ),
2017-04-13 15:53:35 +01:00
'field' => [
2015-08-17 17:00:26 -07:00
'id' => 'standard' ,
2017-04-13 15:53:35 +01:00
],
'argument' => [
2015-08-17 17:00:26 -07:00
'id' => 'string' ,
2017-04-13 15:53:35 +01:00
],
'filter' => [
2018-11-23 12:29:20 +00:00
'id' => 'dblog_types' ,
2017-04-13 15:53:35 +01:00
],
'sort' => [
2015-08-17 17:00:26 -07:00
'id' => 'standard' ,
2017-04-13 15:53:35 +01:00
],
];
2015-08-17 17:00:26 -07:00
2017-04-13 15:53:35 +01:00
$data [ 'watchdog' ][ 'message' ] = [
2015-08-17 17:00:26 -07:00
'title' => t ( 'Message' ),
'help' => t ( 'The actual message of the log entry.' ),
2017-04-13 15:53:35 +01:00
'field' => [
2015-08-17 17:00:26 -07:00
'id' => 'dblog_message' ,
2017-04-13 15:53:35 +01:00
],
'argument' => [
2015-08-17 17:00:26 -07:00
'id' => 'string' ,
2017-04-13 15:53:35 +01:00
],
'filter' => [
2015-08-17 17:00:26 -07:00
'id' => 'string' ,
2017-04-13 15:53:35 +01:00
],
'sort' => [
2015-08-17 17:00:26 -07:00
'id' => 'standard' ,
2017-04-13 15:53:35 +01:00
],
];
2015-08-17 17:00:26 -07:00
2017-04-13 15:53:35 +01:00
$data [ 'watchdog' ][ 'variables' ] = [
2015-08-17 17:00:26 -07:00
'title' => t ( 'Variables' ),
'help' => t ( 'The variables of the log entry in a serialized format.' ),
2017-04-13 15:53:35 +01:00
'field' => [
2015-08-17 17:00:26 -07:00
'id' => 'serialized' ,
'click sortable' => FALSE ,
2017-04-13 15:53:35 +01:00
],
'argument' => [
2015-08-17 17:00:26 -07:00
'id' => 'string' ,
2017-04-13 15:53:35 +01:00
],
'filter' => [
2015-08-17 17:00:26 -07:00
'id' => 'string' ,
2017-04-13 15:53:35 +01:00
],
'sort' => [
2015-08-17 17:00:26 -07:00
'id' => 'standard' ,
2017-04-13 15:53:35 +01:00
],
];
2015-08-17 17:00:26 -07:00
2017-04-13 15:53:35 +01:00
$data [ 'watchdog' ][ 'severity' ] = [
2015-08-17 17:00:26 -07:00
'title' => t ( 'Severity level' ),
'help' => t ( 'The severity level of the event; ranges from 0 (Emergency) to 7 (Debug).' ),
2017-04-13 15:53:35 +01:00
'field' => [
2015-08-17 17:00:26 -07:00
'id' => 'machine_name' ,
'options callback' => 'Drupal\dblog\Controller\DbLogController::getLogLevelClassMap' ,
2017-04-13 15:53:35 +01:00
],
'filter' => [
2015-08-17 17:00:26 -07:00
'id' => 'in_operator' ,
2018-11-23 12:29:20 +00:00
'options callback' => 'Drupal\Core\Logger\RfcLogLevel::getLevels' ,
2017-04-13 15:53:35 +01:00
],
'sort' => [
2015-08-17 17:00:26 -07:00
'id' => 'standard' ,
2017-04-13 15:53:35 +01:00
],
];
2015-08-17 17:00:26 -07:00
2017-04-13 15:53:35 +01:00
$data [ 'watchdog' ][ 'link' ] = [
2015-08-17 17:00:26 -07:00
'title' => t ( 'Operations' ),
'help' => t ( 'Operation links for the event.' ),
2017-04-13 15:53:35 +01:00
'field' => [
2015-08-17 17:00:26 -07:00
'id' => 'dblog_operations' ,
2017-04-13 15:53:35 +01:00
],
'argument' => [
2015-08-17 17:00:26 -07:00
'id' => 'string' ,
2017-04-13 15:53:35 +01:00
],
'filter' => [
2015-08-17 17:00:26 -07:00
'id' => 'string' ,
2017-04-13 15:53:35 +01:00
],
'sort' => [
2015-08-17 17:00:26 -07:00
'id' => 'standard' ,
2017-04-13 15:53:35 +01:00
],
];
2015-08-17 17:00:26 -07:00
2017-04-13 15:53:35 +01:00
$data [ 'watchdog' ][ 'location' ] = [
2015-08-17 17:00:26 -07:00
'title' => t ( 'Location' ),
'help' => t ( 'URL of the origin of the event.' ),
2017-04-13 15:53:35 +01:00
'field' => [
2015-08-17 17:00:26 -07:00
'id' => 'standard' ,
2017-04-13 15:53:35 +01:00
],
'argument' => [
2015-08-17 17:00:26 -07:00
'id' => 'string' ,
2017-04-13 15:53:35 +01:00
],
'filter' => [
2015-08-17 17:00:26 -07:00
'id' => 'string' ,
2017-04-13 15:53:35 +01:00
],
'sort' => [
2015-08-17 17:00:26 -07:00
'id' => 'standard' ,
2017-04-13 15:53:35 +01:00
],
];
2015-08-17 17:00:26 -07:00
2017-04-13 15:53:35 +01:00
$data [ 'watchdog' ][ 'referer' ] = [
2015-08-17 17:00:26 -07:00
'title' => t ( 'Referer' ),
'help' => t ( 'URL of the previous page.' ),
2017-04-13 15:53:35 +01:00
'field' => [
2015-08-17 17:00:26 -07:00
'id' => 'standard' ,
2017-04-13 15:53:35 +01:00
],
'argument' => [
2015-08-17 17:00:26 -07:00
'id' => 'string' ,
2017-04-13 15:53:35 +01:00
],
'filter' => [
2015-08-17 17:00:26 -07:00
'id' => 'string' ,
2017-04-13 15:53:35 +01:00
],
'sort' => [
2015-08-17 17:00:26 -07:00
'id' => 'standard' ,
2017-04-13 15:53:35 +01:00
],
];
2015-08-17 17:00:26 -07:00
2017-04-13 15:53:35 +01:00
$data [ 'watchdog' ][ 'hostname' ] = [
2015-08-17 17:00:26 -07:00
'title' => t ( 'Hostname' ),
'help' => t ( 'Hostname of the user who triggered the event.' ),
2017-04-13 15:53:35 +01:00
'field' => [
2015-08-17 17:00:26 -07:00
'id' => 'standard' ,
2017-04-13 15:53:35 +01:00
],
'argument' => [
2015-08-17 17:00:26 -07:00
'id' => 'string' ,
2017-04-13 15:53:35 +01:00
],
'filter' => [
2015-08-17 17:00:26 -07:00
'id' => 'string' ,
2017-04-13 15:53:35 +01:00
],
'sort' => [
2015-08-17 17:00:26 -07:00
'id' => 'standard' ,
2017-04-13 15:53:35 +01:00
],
];
2015-08-17 17:00:26 -07:00
2017-04-13 15:53:35 +01:00
$data [ 'watchdog' ][ 'timestamp' ] = [
2015-08-17 17:00:26 -07:00
'title' => t ( 'Timestamp' ),
'help' => t ( 'Date when the event occurred.' ),
2017-04-13 15:53:35 +01:00
'field' => [
2015-08-17 17:00:26 -07:00
'id' => 'date' ,
2017-04-13 15:53:35 +01:00
],
'argument' => [
2015-08-17 17:00:26 -07:00
'id' => 'date' ,
2017-04-13 15:53:35 +01:00
],
'filter' => [
2015-08-17 17:00:26 -07:00
'id' => 'date' ,
2017-04-13 15:53:35 +01:00
],
'sort' => [
2015-08-17 17:00:26 -07:00
'id' => 'date' ,
2017-04-13 15:53:35 +01:00
],
];
2015-08-17 17:00:26 -07:00
return $data ;
}