function TestEntityType::setKey

Same name and namespace in other branches
  1. 9 core/modules/views/tests/src/Kernel/Entity/EntityViewsDataTest.php \Drupal\Tests\views\Kernel\Entity\TestEntityType::setKey()
  2. 8.9.x core/modules/views/tests/src/Unit/EntityViewsDataTest.php \Drupal\Tests\views\Unit\TestEntityType::setKey()
  3. 10 core/modules/views/tests/src/Kernel/Entity/EntityViewsDataTest.php \Drupal\Tests\views\Kernel\Entity\TestEntityType::setKey()

Sets a specific entity key.

Parameters

string $key: The name of the entity key.

string $value: The new value of the key.

Return value

$this

File

core/modules/views/tests/src/Kernel/Entity/EntityViewsDataTest.php, line 824

Class

TestEntityType
Entity type class which allows changing the entity keys.

Namespace

Drupal\Tests\views\Kernel\Entity

Code

public function setKey($key, $value) {
    $this->entity_keys[$key] = $value;
    return $this;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.