You are here

public function ContentEntityForm::__construct in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Entity/ContentEntityForm.php \Drupal\Core\Entity\ContentEntityForm::__construct()
  2. 10 core/lib/Drupal/Core/Entity/ContentEntityForm.php \Drupal\Core\Entity\ContentEntityForm::__construct()

Constructs a ContentEntityForm object.

Parameters

\Drupal\Core\Entity\EntityRepositoryInterface $entity_repository: The entity repository service.

\Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_type_bundle_info: The entity type bundle service.

\Drupal\Component\Datetime\TimeInterface $time: The time service.

10 calls to ContentEntityForm::__construct()
AccountForm::__construct in core/modules/user/src/AccountForm.php
Constructs a new EntityForm object.
BookOutlineForm::__construct in core/modules/book/src/Form/BookOutlineForm.php
Constructs a BookOutlineForm object.
CommentForm::__construct in core/modules/comment/src/CommentForm.php
Constructs a new CommentForm.
MenuLinkContentForm::__construct in core/modules/menu_link_content/src/Form/MenuLinkContentForm.php
Constructs a MenuLinkContentForm object.
MessageForm::__construct in core/modules/contact/src/MessageForm.php
Constructs a MessageForm object.

... See full list

10 methods override ContentEntityForm::__construct()
AccountForm::__construct in core/modules/user/src/AccountForm.php
Constructs a new EntityForm object.
BookOutlineForm::__construct in core/modules/book/src/Form/BookOutlineForm.php
Constructs a BookOutlineForm object.
CommentForm::__construct in core/modules/comment/src/CommentForm.php
Constructs a new CommentForm.
MenuLinkContentForm::__construct in core/modules/menu_link_content/src/Form/MenuLinkContentForm.php
Constructs a MenuLinkContentForm object.
MessageForm::__construct in core/modules/contact/src/MessageForm.php
Constructs a MessageForm object.

... See full list

File

core/lib/Drupal/Core/Entity/ContentEntityForm.php, line 56

Class

ContentEntityForm
Entity form variant for content entity types.

Namespace

Drupal\Core\Entity

Code

public function __construct(EntityRepositoryInterface $entity_repository, EntityTypeBundleInfoInterface $entity_type_bundle_info = NULL, TimeInterface $time = NULL) {
  if ($entity_repository instanceof EntityManagerInterface) {
    @trigger_error('Passing the entity.manager service to ContentEntityForm::__construct() is deprecated in Drupal 8.6.0 and will be removed before Drupal 9.0.0. Pass the entity.repository service instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
    $this->entityManager = $entity_repository;
  }
  $this->entityRepository = $entity_repository;
  $this->entityTypeBundleInfo = $entity_type_bundle_info ?: \Drupal::service('entity_type.bundle.info');
  $this->time = $time ?: \Drupal::service('datetime.time');
}