doOne example



    /** @var \Drupal\Core\Config\Entity\ConfigEntityInterface $entity */
    $entities = $storage->loadMultiple(array_splice($sandbox[self::SANDBOX_KEY]['entities'], 0, $this->batchSize));
    foreach ($entities as $entity) {
      try {
        if ($continue_on_error) {
          // If we're continuing on error silence errors from notices that           // missing indexes.           // @todo consider change this to an error handler that converts such           // notices to exceptions in https://www.drupal.org/node/3309886           @$this->doOne($entity$callback);
        }
        else {
          $this->doOne($entity$callback);
        }
      }
      catch (\Throwable $throwable) {
        if (!$continue_on_error) {
          throw $throwable;
        }
        $context['%view'] = $entity->id();
        $context['%entity_type'] = $entity_type_id;
        
Home | Imprint | This part of the site doesn't use cookies.