function WorkspacePublisher::getNumberOfChangesOnTarget

Same name and namespace in other branches
  1. 9 core/modules/workspaces/src/WorkspacePublisher.php \Drupal\workspaces\WorkspacePublisher::getNumberOfChangesOnTarget()
  2. 8.9.x core/modules/workspaces/src/WorkspacePublisher.php \Drupal\workspaces\WorkspacePublisher::getNumberOfChangesOnTarget()
  3. 11.x core/modules/workspaces/src/WorkspacePublisher.php \Drupal\workspaces\WorkspacePublisher::getNumberOfChangesOnTarget()

Gets the total number of items which have changed on the target.

This returns the aggregated changes count across all entity types. For example, if two nodes and one taxonomy term have changed on the target, the return value is 3.

Return value

int The number of differing revisions.

Overrides WorkspaceOperationInterface::getNumberOfChangesOnTarget

File

core/modules/workspaces/src/WorkspacePublisher.php, line 238

Class

WorkspacePublisher
Default implementation of the workspace publisher.

Namespace

Drupal\workspaces

Code

public function getNumberOfChangesOnTarget() {
    $total_changes = $this->getDifferringRevisionIdsOnTarget();
    return count($total_changes, COUNT_RECURSIVE) - count($total_changes);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.