unsetThirdPartySetting example

/** * {@inheritdoc} */
  public function getThirdPartySettings($module) {
    return $this->getDisplay()->getThirdPartySettings($module);
  }

  /** * {@inheritdoc} */
  public function unsetThirdPartySetting($module$key) {
    $this->getDisplay()->unsetThirdPartySetting($module$key);
    return $this;
  }

  /** * {@inheritdoc} */
  public function getThirdPartyProviders() {
    return $this->getDisplay()->getThirdPartyProviders();
  }

  /** * {@inheritdoc} */
/** * {@inheritdoc} */
  public function getThirdPartySettings($module) {
    return $this->storage->getThirdPartySettings($module);
  }

  /** * {@inheritdoc} */
  public function unsetThirdPartySetting($module$key) {
    return $this->storage->unsetThirdPartySetting($module$key);
  }

  /** * {@inheritdoc} */
  public function getThirdPartyProviders() {
    return $this->storage->getThirdPartyProviders();
  }

  /** * {@inheritdoc} */
$field_definition = [
      'field_name' => $field_name,
      'entity_type' => 'taxonomy_term',
      'bundle' => $vocabulary->id(),
      'label' => $this->randomMachineName() . '_label',
    ];
    FieldConfig::create($field_definition)->save();

    // Remove the third party setting from the memory copy of the vocabulary.     // We keep this invalid copy around while the taxonomy module is not even     // installed for testing below.     $vocabulary->unsetThirdPartySetting('taxonomy_crud', 'foo');

    $this->container->get('module_installer')->uninstall(['taxonomy']);
    $this->container->get('module_installer')->install(['taxonomy']);

    // Now create a vocabulary with the same name. All fields connected to this     // vocabulary name should have been removed when the module was uninstalled.     // Creating a new field with the same name and an instance of this field on     // the same bundle name should be successful.     $vocabulary->enforceIsNew()->save();
    FieldStorageConfig::create($storage_definition)->save();
    FieldConfig::create($field_definition)->save();
  }
'new_setting' => 'new_value',
      ],
    ];
    return $data;
  }

  /** * @covers ::unsetThirdPartySetting * @dataProvider providerTestUnsetThirdPartySetting */
  public function testUnsetThirdPartySetting($provider$key$expected) {
    $this->section->unsetThirdPartySetting($provider$key);
    $this->assertSame($expected$this->section->getThirdPartySettings($provider));
  }

  /** * Provides test data for ::testUnsetThirdPartySetting(). */
  public function providerTestUnsetThirdPartySetting() {
    $data = [];
    $data['Key with values'] = [
      'bad_judgement',
      'blink_speed',
      [
public function getSections() {
    return $this->getThirdPartySetting('layout_builder', 'sections', []);
  }

  /** * {@inheritdoc} */
  protected function setSections(array $sections) {
    // Third-party settings must be completely unset instead of stored as an     // empty array.     if (!$sections) {
      $this->unsetThirdPartySetting('layout_builder', 'sections');
    }
    else {
      $this->setThirdPartySetting('layout_builder', 'sections', array_values($sections));
    }
    return $this;
  }

  /** * {@inheritdoc} */
  public function preSave(EntityStorageInterface $storage) {
    
$this->assertEquals($value$this->entity->getThirdPartySetting($third_party$key$this->getRandomGenerator()->string()));

    // Test getThirdPartySettings().     $this->entity->setThirdPartySetting($third_party, 'test2', 'value2');
    $this->assertEquals([$key => $value, 'test2' => 'value2']$this->entity->getThirdPartySettings($third_party));

    // Test getThirdPartyProviders().     $this->entity->setThirdPartySetting('test_provider2', $key$value);
    $this->assertEquals([$third_party, 'test_provider2']$this->entity->getThirdPartyProviders());

    // Test unsetThirdPartyProviders().     $this->entity->unsetThirdPartySetting('test_provider2', $key);
    $this->assertEquals([$third_party]$this->entity->getThirdPartyProviders());
  }

  /** * @covers ::toArray */
  public function testToArraySchemaException() {
    $this->entityType->expects($this->any())
      ->method('getPropertiesToExport')
      ->willReturn(NULL);
    $this->entityType->expects($this->any())
      
Home | Imprint | This part of the site doesn't use cookies.