SimpleLcaResolver.php in Conflict 8
File
src/SimpleLcaResolver.php
View source
<?php
namespace Drupal\conflict;
use Drupal\Core\Entity\RevisionableInterface;
use Fhaculty\Graph\Graph;
class SimpleLcaResolver implements ConflictAncestorResolverInterface {
public function applies() {
return TRUE;
}
public function resolve(RevisionableInterface $revision1, RevisionableInterface $revision2, Graph $graph = NULL) {
$revid1 = $revision1
->getRevisionId();
$revid2 = $revision2
->getRevisionId();
if ($revid1 < $revid2) {
return $revid1 - 1;
}
return $revid2 - 1;
}
}