Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Entity/EntityType.php \Drupal\Core\Entity\EntityType::setClass()
  2. 9 core/lib/Drupal/Core/Entity/EntityType.php \Drupal\Core\Entity\EntityType::setClass()

Sets the class.

Parameters

string $class: A fully qualified class name.

Return value

static

Throws

\InvalidArgumentException If the class is invalid.

Overrides PluginDefinition::setClass

File

core/lib/Drupal/Core/Entity/EntityType.php, line 432

Class

EntityType
Provides an implementation of an entity type and its metadata.

Namespace

Drupal\Core\Entity

Code

public function setClass($class) {
  if (!$this->originalClass && $this->class) {

    // If the original class is currently not set, set it to the current
    // class, assume that is the original class name.
    $this->originalClass = $this->class;
  }
  return parent::setClass($class);
}