class ComplexLcaResolver in Multiversion 8
Same name and namespace in other branches
- 8.2 src/Entity/Index/ComplexLcaResolver.php \Drupal\Multiversion\Entity\Index\ComplexLcaResolver
Hierarchy
- class \Drupal\Multiversion\Entity\Index\ComplexLcaResolver implements ConflictAncestorResolverInterface
Expanded class hierarchy of ComplexLcaResolver
File
- src/
Entity/ Index/ ComplexLcaResolver.php, line 10
Namespace
Drupal\Multiversion\Entity\IndexView source
class ComplexLcaResolver implements ConflictAncestorResolverInterface {
/**
* {@inheritdoc}
*/
public function applies() {
return TRUE;
}
/**
* Find the lowest common parent of two revisions from given graph.
*
* @param RevisionableInterface $revision1
* @param RevisionableInterface $revision2
* @param Graph $graph
*
* @return array
* Returns an array of vertices or an empty array.
*/
public function resolve(RevisionableInterface $revision1, RevisionableInterface $revision2, Graph $graph = NULL) {
$lca = new LowestCommonAncestor($graph);
$vertices = $graph
->getVertices()
->getMap();
return $lca
->find($vertices[$revision1->_rev->value], $vertices[$revision2->_rev->value]);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ComplexLcaResolver:: |
public | function |
Overrides ConflictAncestorResolverInterface:: |
|
ComplexLcaResolver:: |
public | function |
Find the lowest common parent of two revisions from given graph. Overrides ConflictAncestorResolverInterface:: |