refactor: #3560398 Move _dblog_get_message_types and dblog_filters to a...
refactor: #3560398 Move _dblog_get_message_types and dblog_filters to a DbLogFilters service and deprecate them
By: nicxvan
By: mstrelan
By: smustgrave
By: dww
By: dagmar
By: longwave
By: dcam
(cherry picked from commit 51c8bbe6)
@trigger_error(__FILE__.' is deprecated in drupal:11.4.0 and is removed from drupal:12.0.0. Use \Drupal::service(\Drupal\dblog\DbLogFilters::class)->filters() instead. See https://www.drupal.org/node/3560399',E_USER_DEPRECATED);
* Gathers a list of uniquely defined database log message types.
*
* @return array
* List of uniquely defined database log message types.
*
* @deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Use \Drupal::service(\Drupal\dblog\DbLogFilters::class)->getMessageTypes() instead.
* @see https://www.drupal.org/node/3560399
*/
function_dblog_get_message_types(){
return\Drupal::database()->query('SELECT DISTINCT([type]) FROM {watchdog} ORDER BY [type]')
->fetchAllKeyed(0,0);
@trigger_error(__FUNCTION__.'() is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Use \Drupal::service(\Drupal\dblog\DbLogFilters::class)->getMessageTypes() instead. See https://www.drupal.org/node/3560399',E_USER_DEPRECATED);
* Creates a list of database log administration filters that can be applied.
*
* @return array
* Associative array of filters. The top-level keys are used as the form
* element names for the filters, and the values are arrays with the following
* elements:
* - title: Title of the filter.
* - where: The filter condition.
* - options: Array of options for the select list for the filter.
*
* @deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Use \Drupal::service(\Drupal\dblog\DbLogFilters::class)->filters() instead.
* @see https://www.drupal.org/node/3560399
*/
functiondblog_filters():array{
@trigger_error(__FUNCTION__.'() is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Use \Drupal::service(\Drupal\dblog\DbLogFilters::class)->filters() instead. See https://www.drupal.org/node/3560399',E_USER_DEPRECATED);