function EntityTest::getEntityKey
Gets the value of the given entity key, if defined.
Parameters
string $key: Name of the entity key, for example id, revision or bundle.
Return value
mixed The value of the entity key, NULL if not defined.
Overrides ContentEntityBase::getEntityKey
File
-
core/
modules/ system/ tests/ modules/ entity_test/ src/ Entity/ EntityTest.php, line 169
Class
- EntityTest
- Defines the test entity class.
Namespace
Drupal\entity_test\EntityCode
public function getEntityKey($key) {
// Typically this protected method is used internally by entity classes and
// exposed publicly through more specific getter methods. So that test cases
// are able to set and access entity keys dynamically, update the visibility
// of this method to public.
return parent::getEntityKey($key);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.