You are here

class AllDocsFactory in Replication 8

Same name and namespace in other branches
  1. 8.2 src/AllDocsFactory.php \Drupal\replication\AllDocsFactory

Hierarchy

Expanded class hierarchy of AllDocsFactory

1 string reference to 'AllDocsFactory'
replication.services.yml in ./replication.services.yml
replication.services.yml
1 service uses AllDocsFactory
replication.alldocs_factory in ./replication.services.yml
Drupal\replication\AllDocsFactory

File

src/AllDocsFactory.php, line 12

Namespace

Drupal\replication
View source
class AllDocsFactory implements BulkDocsFactoryInterface {

  /**
   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
   */
  protected $entityTypeManager;

  /**
   * @var \Drupal\replication\BulkDocs\BulkDocs[]
   */
  protected $instances = [];

  /**
   * Constructor.
   *
   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
   * @param \Drupal\multiversion\MultiversionManagerInterface $multiversion_manager
   * @param \Drupal\multiversion\Entity\Index\EntityIndexInterface $entity_index
   * @param \Symfony\Component\Serializer\SerializerInterface $serializer
   */
  public function __construct(EntityTypeManagerInterface $entity_type_manager, MultiversionManagerInterface $multiversion_manager, EntityIndexInterface $entity_index, SerializerInterface $serializer) {
    $this->entityTypeManager = $entity_type_manager;
    $this->multiversionManager = $multiversion_manager;
    $this->entityIndex = $entity_index;
    $this->serializer = $serializer;
  }

  /**
   * @inheritDoc
   */
  public function get(WorkspaceInterface $workspace) {
    if (!isset($this->instances[$workspace
      ->id()])) {
      $this->instances[$workspace
        ->id()] = new AllDocs($this->entityTypeManager, $this->multiversionManager, $workspace, $this->entityIndex, $this->serializer);
    }
    return $this->instances[$workspace
      ->id()];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AllDocsFactory::$entityTypeManager protected property
AllDocsFactory::$instances protected property
AllDocsFactory::get public function @inheritDoc Overrides BulkDocsFactoryInterface::get
AllDocsFactory::__construct public function Constructor.