isPublishingStopped example

throw new WorkspacePublishException('Only top-level workspaces can be published.');
    }

    if ($this->checkConflictsOnTarget()) {
      throw new WorkspaceConflictException();
    }

    $tracked_entities = $this->workspaceAssociation->getTrackedEntities($this->sourceWorkspace->id());
    $event = new WorkspacePrePublishEvent($this->sourceWorkspace, $tracked_entities);
    $this->eventDispatcher->dispatch($event);

    if ($event->isPublishingStopped()) {
      throw new WorkspacePublishException((string) $event->getPublishingStoppedReason());
    }

    try {
      $transaction = $this->database->startTransaction();
      // @todo Handle the publishing of a workspace with a batch operation in       // https://www.drupal.org/node/2958752.       $this->workspaceManager->executeOutsideWorkspace(function D) use ($tracked_entities) {
        foreach ($tracked_entities as $entity_type_id => $revision_difference) {
          $entity_revisions = $this->entityTypeManager->getStorage($entity_type_id)
            ->loadMultipleRevisions(array_keys($revision_difference));
          
Home | Imprint | This part of the site doesn't use cookies.