Skip to content

Commit a431313

Browse files
committed
Remove clearCachedFieldDefinitions() from EntityTypeForm
1 parent 5ec9c4a commit a431313

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

templates/d8/module/content-entity/src/Form/ExampleTypeForm.php.twig

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,14 @@
33
namespace Drupal\{{ machine_name }}\Form;
44
55
use Drupal\Core\Entity\BundleEntityFormBase;
6-
use Drupal\Core\Entity\EntityManagerInterface;
76
use Drupal\Core\Entity\EntityTypeInterface;
87
use Drupal\Core\Form\FormStateInterface;
9-
use Symfony\Component\DependencyInjection\ContainerInterface;
108
119
/**
1210
* Form handler for {{ entity_type_label|lower }} type forms.
1311
*/
1412
class {{ class_prefix }}TypeForm extends BundleEntityFormBase {
1513
16-
/**
17-
* The entity manager.
18-
*
19-
* @var \Drupal\Core\Entity\EntityManagerInterface
20-
*/
21-
protected $entityManager;
22-
23-
/**
24-
* Constructs the {{ class_prefix }}TypeForm object.
25-
*
26-
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
27-
* The entity manager.
28-
*/
29-
public function __construct(EntityManagerInterface $entity_manager) {
30-
$this->entityManager = $entity_manager;
31-
}
32-
33-
/**
34-
* {@inheritdoc}
35-
*/
36-
public static function create(ContainerInterface $container) {
37-
return new static(
38-
$container->get('entity.manager')
39-
);
40-
}
41-
4214
/**
4315
* {@inheritdoc}
4416
*/
@@ -109,7 +81,6 @@ class {{ class_prefix }}TypeForm extends BundleEntityFormBase {
10981
}
11082
$this->messenger()->addStatus($message);
11183
112-
$this->entityManager->clearCachedFieldDefinitions();
11384
$form_state->setRedirectUrl($entity_type->toUrl('collection'));
11485
}
11586

0 commit comments

Comments
 (0)