You are here

class LcaManager in Conflict 8

Hierarchy

Expanded class hierarchy of LcaManager

1 string reference to 'LcaManager'
conflict.services.yml in ./conflict.services.yml
conflict.services.yml
1 service uses LcaManager
conflict.lca_manager in ./conflict.services.yml
Drupal\conflict\LcaManager

File

src/LcaManager.php, line 8

Namespace

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

  /**
   *
   * @param ConflictAncestorResolverInterface $resolver
   */
  public function addLcaResolver(ConflictAncestorResolverInterface $resolver) {
    $this->resolvers[] = $resolver;
  }

  /**
   * @param RevisionableInterface $revision1
   * @param RevisionableInterface $revision2
   * @param \Fhaculty\Graph\Graph $graph
   *
   * @return int revision_ID
   */
  public function resolveLowestCommonAncestor(RevisionableInterface $revision1, RevisionableInterface $revision2, Graph $graph = NULL) {
    foreach ($this->resolvers as $resolver) {
      if ($resolver
        ->applies()) {
        return $resolver
          ->resolve($revision1, $revision2, $graph);
      }
    }
  }

}

Members