You are here

UltimateCronDatabaseFactory.php in Ultimate Cron 8.2

File

src/UltimateCronDatabaseFactory.php
View source
<?php

namespace Drupal\ultimate_cron;

use Drupal\Core\Database\Database;

/**
 * Class DatabaseFactory
 */
class UltimateCronDatabaseFactory {

  /**
   * Factory method that returns a Connection object with the correct target.
   *
   * @return \Drupal\Core\Database\Connection
   *   The connection object.
   */
  public static function getConnection() {
    $target = _ultimate_cron_get_transactional_safe_connection();
    return Database::getConnection($target);
  }

}

Classes

Namesort descending Description
UltimateCronDatabaseFactory Class DatabaseFactory