You are here

public function UltimateCronDatabaseLogger::getLogEntries in Ultimate Cron 7.2

Get log entries.

Overrides UltimateCronLogger::getLogEntries

File

plugins/ultimate_cron/logger/database.class.php, line 351
Database logger for Ultimate Cron.

Class

UltimateCronDatabaseLogger
Class for using database as log storage.

Code

public function getLogEntries($name, $log_types, $limit = 10) {
  $result = db_select('ultimate_cron_log', 'l')
    ->fields('l')
    ->extend('PagerDefault')
    ->condition('l.name', $name)
    ->condition('l.log_type', $log_types, 'IN')
    ->limit($limit)
    ->orderBy('l.start_time', 'DESC')
    ->execute();
  $log_entries = array();
  while ($object = $result
    ->fetchObject($this->log_entry_class, array(
    $name,
    $this,
  ))) {
    $log_entries[$object->lid] = $object;
  }
  return $log_entries;
}