populateAffectedRevisionTranslations example

if ($this->entityType->isRevisionable()) {
        $entity->setNewRevision();
      }
      $return = SAVED_NEW;
    }
    else {
      // @todo Consider returning a different value when saving a non-default       // entity revision. See https://www.drupal.org/node/2509360.       $return = $entity->isDefaultRevision() ? SAVED_UPDATED : FALSE;
    }

    $this->populateAffectedRevisionTranslations($entity);

    // Populate the "revision_default" flag. Skip this when we are resaving     // the revision, and the flag is set to FALSE, since it is not possible to     // set a previously default revision to non-default. However, setting a     // previously non-default revision to default is allowed for advanced     // use-cases.     if ($this->entityType->isRevisionable() && ($entity->isNewRevision() || $entity->isDefaultRevision())) {
      $revision_default_key = $this->entityType->getRevisionMetadataKey('revision_default');
      $entity->set($revision_default_key$entity->isDefaultRevision());
    }

    
Home | Imprint | This part of the site doesn't use cookies.