You are here

class QueueMongodbFactory in MongoDB 8

Defines the queue factory for the MongoDB backend.

Hierarchy

Expanded class hierarchy of QueueMongodbFactory

1 string reference to 'QueueMongodbFactory'
mongodb.services.yml in ./mongodb.services.yml
mongodb.services.yml
1 service uses QueueMongodbFactory
queue.mongodb in ./mongodb.services.yml
Drupal\mongodb\QueueMongodbFactory

File

src/QueueMongodbFactory.php, line 13
Contains \Drupal\mongodb\QueueMongodbFactory.

Namespace

Drupal\mongodb
View source
class QueueMongodbFactory {

  /**
   * Mongo collection factory.
   *
   * @var \Drupal\mongodb\MongoCollectionFactory $mongo
   */
  protected $mongo;

  /**
   * Constructs this factory object.
   *
   * @param \Drupal\mongodb\MongoCollectionFactory $mongo
   *   Mongo collection factory.
   */
  function __construct(MongoCollectionFactory $mongo) {
    $this->mongo = $mongo;
  }

  /**
   * Constructs a new queue object for a given name.
   *
   * @param string $name
   *   The name of the collection holding key and value pairs.
   *
   * @return \Drupal\mongodb\QueueMongodb
   *   A queue implementation for the given queue.
   */
  public function get($name) {
    return new QueueMongodb($this->mongo, $name);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
QueueMongodbFactory::$mongo protected property Mongo collection factory.
QueueMongodbFactory::get public function Constructs a new queue object for a given name.
QueueMongodbFactory::__construct function Constructs this factory object.