class SimpleLcaResolver in Conflict 8
Hierarchy
- class \Drupal\conflict\SimpleLcaResolver implements ConflictAncestorResolverInterface
Expanded class hierarchy of SimpleLcaResolver
1 string reference to 'SimpleLcaResolver'
1 service uses SimpleLcaResolver
File
- src/
SimpleLcaResolver.php, line 8
Namespace
Drupal\conflictView source
class SimpleLcaResolver implements ConflictAncestorResolverInterface {
/**
* {@inheritdoc}
*/
public function applies() {
return TRUE;
}
/**
* Finds the smallest revision id and calculates it's parent
*
* @param RevisionableInterface $revision1
* @param RevisionableInterface $revision2
*
* @return int parent of both revisions
*/
public function resolve(RevisionableInterface $revision1, RevisionableInterface $revision2, Graph $graph = NULL) {
// Calculating revision ID from revision object.
$revid1 = $revision1
->getRevisionId();
$revid2 = $revision2
->getRevisionId();
if ($revid1 < $revid2) {
return $revid1 - 1;
}
return $revid2 - 1;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SimpleLcaResolver:: |
public | function |
Overrides ConflictAncestorResolverInterface:: |
|
SimpleLcaResolver:: |
public | function |
Finds the smallest revision id and calculates it's parent Overrides ConflictAncestorResolverInterface:: |