class QueueDatabaseFactory

Defines the key/value store factory for the database backend.

Hierarchy

Expanded class hierarchy of QueueDatabaseFactory

1 string reference to 'QueueDatabaseFactory'
core.services.yml in drupal/core/core.services.yml
drupal/core/core.services.yml
1 service uses QueueDatabaseFactory

File

drupal/core/lib/Drupal/Core/Queue/QueueDatabaseFactory.php, line 15
Contains \Drupal\Core\Queue\QueueDatabaseFactory.

Namespace

Drupal\Core\Queue
View source
class QueueDatabaseFactory {

  /**
   * The database connection.
   *
   * @var \Drupal\Core\Database\Connection $connection
   */
  protected $connection;

  /**
   * Constructs this factory object.
   *
   * @param \Drupal\Core\Database\Connection $connection
   *   The Connection object containing the key-value tables.
   */
  function __construct(Connection $connection) {
    $this->connection = $connection;
  }

  /**
   * Constructs a new queue object for a given name.
   *
   * @param string $name
   *   The name of the collection holding key and value pairs.
   * @param \Drupal\Core\Database\Connection $connection
   *   The connection to run against.
   *
   * @return \Drupal\Core\QueueStore\DatabaseStorage
   *   A key/value store implementation for the given $collection.
   */
  public function get($name) {
    return new DatabaseQueue($name, $this->connection);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
QueueDatabaseFactory::$connection protected property The database connection.
QueueDatabaseFactory::get public function Constructs a new queue object for a given name.
QueueDatabaseFactory::__construct function Constructs this factory object.