You are here

public function WebformEntityStorageTrait::__get in Webform 6.x

Implements the magic __get() method.

Parameters

string $name: The name of the variable to return.

Return value

\Drupal\Core\Entity\EntityStorageInterface Entity storage or NULL.

File

src/EntityStorage/WebformEntityStorageTrait.php, line 85

Class

WebformEntityStorageTrait
Trait for webform entity storage management.

Namespace

Drupal\webform\EntityStorage

Code

public function __get($name) {
  if (isset($this->entityStorageToTypeMappings[$name])) {
    $entity_type = $this->entityStorageToTypeMappings[$name];
    $class_name = get_class($this);
    @trigger_error("{$class_name}::{$name} is deprecated in Webform 6.x and is removed from Webform 7.x Use \$this->entityTypeManager->getStorage('{$entity_type}') instead", E_USER_DEPRECATED);
    return $this->entityTypeManager
      ->getStorage($entity_type);
  }
}