abstract class MergeStrategyBase in Conflict 8.2
Hierarchy
- class \Drupal\conflict\ConflictResolution\MergeStrategyBase implements MergeStrategyInterface
Expanded class hierarchy of MergeStrategyBase
1 file declares its use of MergeStrategyBase
- MergeRemoteStructure.php in modules/
conflict_paragraphs/ src/ ConflictResolution/ MergeRemoteStructure.php
File
- src/
ConflictResolution/ MergeStrategyBase.php, line 9
Namespace
Drupal\conflict\ConflictResolutionView source
abstract class MergeStrategyBase implements MergeStrategyInterface {
/**
* Discovers conflicts on entities.
*
* @param \Drupal\conflict\Event\EntityConflictResolutionEvent
* The entity conflict resolution event.
*/
public function resolveConflicts(EntityConflictResolutionEvent $event) {
if ($this
->isEnabled($event)) {
$local_entity = $event
->getLocalEntity();
if ($local_entity instanceof ContentEntityInterface) {
$this
->resolveConflictsContentEntity($event);
}
}
}
/**
* {@inheritdoc}
*/
public function isEnabled(EntityConflictResolutionEvent $event) : bool {
$disabled_merge_strategies = $event
->getContextParameter('merge_strategy.disabled', []);
return !in_array($this
->getMergeStrategyId(), $disabled_merge_strategies, TRUE);
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents() {
$events[EntityConflictEvents::ENTITY_CONFLICT_RESOLVE][] = [
'resolveConflicts',
];
return $events;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MergeStrategyBase:: |
public static | function | Returns an array of event names this subscriber wants to listen to. | |
MergeStrategyBase:: |
public | function |
Checks whether this merge strategy is active for the conflict resolution. Overrides MergeStrategyInterface:: |
|
MergeStrategyBase:: |
public | function | Discovers conflicts on entities. | |
MergeStrategyInterface:: |
public | function | Returns the merge strategy ID. | 2 |
MergeStrategyInterface:: |
public | function | Resolves conflicts on content entities. | 2 |