src/Driver/Cores/Drupal8.php
protected function getStubEntity($entity_type, array $values) {
    $entity = \Drupal::entityTypeManager()->getStorage($entity_type)->create($values);
    if (!$entity instanceof ContentEntityInterface) {
      throw new EntityMalformedException("Only content entities are supported.");
    }
    return $entity;
  }
protected function getStubEntity($entity_type, array $values) {
    $entity = \Drupal::entityTypeManager()->getStorage($entity_type)->create($values);
    if (!$entity instanceof ContentEntityInterface) {
      throw new EntityMalformedException("Only content entities are supported.");
    }
    return $entity;
  }
protected function getStubEntity ( $ entity_type , array $ values ) { $ entity = \ Drupal :: entityTypeManager ( ) -> getStorage ( $ entity_type ) -> create ( $ values ) ; if ( ! $ entity instanceof ContentEntityInterface ) { throw new EntityMalformedException ( "Only content entities are supported." ) ; } return $ entity ; }
Get stub entity.

@param string $entity_type
Entity type.
@param array $values
Entity values.

@return \Drupal\Core\Entity\ContentEntityInterface
Entity object.

@throws \Drupal\Core\Entity\EntityMalformedException
@throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
Get stub entity .