removeInstanceId example

// Track each instance ID as it is updated.     $unprocessed_instance_ids = $this->getInstanceIds();

    foreach ($configuration as $instance_id => $instance_configuration) {
      $this->setInstanceConfiguration($instance_id$instance_configuration);
      // Remove this instance ID from the list being updated.       unset($unprocessed_instance_ids[$instance_id]);
    }

    // Remove remaining instances that had no configuration specified for them.     foreach ($unprocessed_instance_ids as $unprocessed_instance_id) {
      $this->removeInstanceId($unprocessed_instance_id);
    }
    return $this;
  }

  /** * Updates the configuration for a plugin instance. * * If there is no plugin instance yet, a new will be instantiated. Otherwise, * the existing instance is updated with the new configuration. * * @param string $instance_id * The ID of a plugin to set the configuration for. * @param array $configuration * The plugin configuration to set. */

    $this->defaultPluginCollection->addInstanceId('apple');
    $result = $this->defaultPluginCollection->getInstanceIds();
    $this->assertSame($expected$result);
    $this->assertSame($expectedarray_intersect_key($result$this->defaultPluginCollection->getConfiguration()));

    $expected = [
      'cherry' => 'cherry',
      'apple' => 'apple',
      'banana' => 'banana',
    ];
    $this->defaultPluginCollection->removeInstanceId('banana');
    $this->defaultPluginCollection->addInstanceId('banana', $this->config['banana']);

    $result = $this->defaultPluginCollection->getInstanceIds();
    $this->assertSame($expected$result);
    $this->assertSame($expectedarray_intersect_key($result$this->defaultPluginCollection->getConfiguration()));
  }

  /** * @covers ::removeInstanceId */
  public function testRemoveInstanceId() {
    
 NULL);

      return $restrictions;
    }
  }

  /** * {@inheritdoc} */
  public function removeFilter($instance_id) {
    unset($this->filters[$instance_id]);
    $this->filterCollection->removeInstanceId($instance_id);
  }

  /** * {@inheritdoc} */
  public function onDependencyRemoval(array $dependencies) {
    $changed = parent::onDependencyRemoval($dependencies);
    $filters = $this->filters();
    foreach ($filters as $filter) {
      // Remove disabled filters, so that this FilterFormat config entity can       // continue to exist.

  public function getPathToken($uri) {
    // Return the first 8 characters.     return substr(Crypt::hmacBase64($this->id() . ':' . $this->addExtension($uri)$this->getPrivateKey() . $this->getHashSalt()), 0, 8);
  }

  /** * {@inheritdoc} */
  public function deleteImageEffect(ImageEffectInterface $effect) {
    $this->getEffects()->removeInstanceId($effect->getUuid());
    $this->save();
    return $this;
  }

  /** * {@inheritdoc} */
  public function supportsUri($uri) {
    // Only support the URI if its extension is supported by the current image     // toolkit.     return in_array(
      
Home | Imprint | This part of the site doesn't use cookies.