You are here

class ConflictManager in Conflict 8

Hierarchy

Expanded class hierarchy of ConflictManager

1 string reference to 'ConflictManager'
conflict.services.yml in ./conflict.services.yml
conflict.services.yml
1 service uses ConflictManager
conflict.merge_manager in ./conflict.services.yml
Drupal\conflict\ConflictManager

File

src/ConflictManager.php, line 7

Namespace

Drupal\conflict
View source
class ConflictManager {
  protected $resolvers = [];

  /**
   * @param \Drupal\conflict\ConflictResolverInterface $resolver
   */
  public function addConflictResolver(ConflictResolverInterface $resolver) {
    $this->resolvers[] = $resolver;
  }

  /**
   * @param \Drupal\Core\Entity\RevisionableInterface $revision1
   * @param \Drupal\Core\Entity\RevisionableInterface $revision2
   * @param \Drupal\Core\Entity\RevisionableInterface $revision3
   *
   * @return mixed
   */
  public function resolveSimpleMerge(RevisionableInterface $revision1, RevisionableInterface $revision2, RevisionableInterface $revision3) {
    foreach ($this->resolvers as $resolver) {
      if ($resolver
        ->applies()) {
        return $resolver
          ->merge($revision1, $revision2, $revision3);
      }
    }
  }

}

Members