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

Gets any arbitrary property.

Parameters

string $property: The property to retrieve.

Return value

mixed The value for that property, or NULL if the property does not exist.

Overrides EntityTypeInterface::get

File

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

Class

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

Namespace

Drupal\Core\Entity

Code

public function get($property) {
  if (property_exists($this, $property)) {
    $value = $this->{$property} ?? NULL;
  }
  else {
    $value = $this->additional[$property] ?? NULL;
  }
  return $value;
}