You are here

class ChangesFactory in Replication 8

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

Hierarchy

Expanded class hierarchy of ChangesFactory

1 string reference to 'ChangesFactory'
replication.services.yml in ./replication.services.yml
replication.services.yml
1 service uses ChangesFactory
replication.changes_factory in ./replication.services.yml
Drupal\replication\ChangesFactory

File

src/ChangesFactory.php, line 12

Namespace

Drupal\replication
View source
class ChangesFactory implements ChangesFactoryInterface {

  /**
   * @var \Drupal\multiversion\Entity\Index\SequenceIndexInterface
   */
  protected $sequenceIndex;

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

  /**
   * @var \Symfony\Component\Serializer\SerializerInterface
   */
  protected $serializer;

  /**
   * @var \Drupal\replication\Plugin\ReplicationFilterManagerInterface
   */
  protected $filterManager;

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

  /**
   * @param \Drupal\multiversion\Entity\Index\SequenceIndexInterface $sequence_index
   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
   * @param \Symfony\Component\Serializer\SerializerInterface $serializer
   * @param \Drupal\replication\Plugin\ReplicationFilterManagerInterface $filter_manager
   */
  public function __construct(SequenceIndexInterface $sequence_index, EntityTypeManagerInterface $entity_type_manager, SerializerInterface $serializer, ReplicationFilterManagerInterface $filter_manager) {
    $this->sequenceIndex = $sequence_index;
    $this->entityTypeManager = $entity_type_manager;
    $this->serializer = $serializer;
    $this->filterManager = $filter_manager;
  }

  /**
   * {@inheritdoc}
   */
  public function get(WorkspaceInterface $workspace) {
    if (!isset($this->instances[$workspace
      ->id()])) {
      $this->instances[$workspace
        ->id()] = new Changes($this->sequenceIndex, $workspace, $this->entityTypeManager, $this->serializer, $this->filterManager);
    }
    return $this->instances[$workspace
      ->id()];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ChangesFactory::$entityTypeManager protected property
ChangesFactory::$filterManager protected property
ChangesFactory::$instances protected property
ChangesFactory::$sequenceIndex protected property
ChangesFactory::$serializer protected property
ChangesFactory::get public function Constructs a new Changes instance. Overrides ChangesFactoryInterface::get
ChangesFactory::__construct public function