protected static function RevisionTreeIndex::updateDefaultRevision in Multiversion 8.2
Same name and namespace in other branches
- 8 src/Entity/Index/RevisionTreeIndex.php \Drupal\multiversion\Entity\Index\RevisionTreeIndex::updateDefaultRevision()
Helper method to update the default revision.
1 call to RevisionTreeIndex::updateDefaultRevision()
- RevisionTreeIndex::doBuildTree in src/
Entity/ Index/ RevisionTreeIndex.php - Recursive helper method to build the revision tree.
File
- src/
Entity/ Index/ RevisionTreeIndex.php, line 388
Class
- RevisionTreeIndex
- The revision tree index.
Namespace
Drupal\multiversion\Entity\IndexCode
protected static function updateDefaultRevision(&$tree, $default_rev) {
// @todo: {@link https://www.drupal.org/node/2597442 We can temporarily
// flip the sort to find the default rev earlier.}
foreach ($tree as &$element) {
if (isset($element['#rev']) && $element['#rev'] == $default_rev['#rev']) {
$element['#rev_info']['default'] = TRUE;
$element['#rev_info']['conflict'] = FALSE;
break;
}
if (!empty($element['children'])) {
self::updateDefaultRevision($element['children'], $default_rev);
}
}
}