You are here

public function EntityLegalController::documentVersionForm in Entity Legal 3.0.x

Same name and namespace in other branches
  1. 8.2 src/Controller/EntityLegalController.php \Drupal\entity_legal\Controller\EntityLegalController::documentVersionForm()
  2. 4.0.x src/Controller/EntityLegalController.php \Drupal\entity_legal\Controller\EntityLegalController::documentVersionForm()

Page callback for the Entity Legal Document Version form.

Parameters

\Drupal\entity_legal\EntityLegalDocumentInterface $entity_legal_document: The entity legal document.

\Symfony\Component\HttpFoundation\Request $request: The current request object.

Return value

array A form array as expected by drupal_render().

1 string reference to 'EntityLegalController::documentVersionForm'
entity_legal.routing.yml in ./entity_legal.routing.yml
entity_legal.routing.yml

File

src/Controller/EntityLegalController.php, line 125

Class

EntityLegalController
Class EntityLegalController.

Namespace

Drupal\entity_legal\Controller

Code

public function documentVersionForm(EntityLegalDocumentInterface $entity_legal_document, Request $request) {
  $entity_legal_document_version = $this->entityLegalDocumentVersionStorage
    ->create([
    'document_name' => $entity_legal_document
      ->id(),
  ]);
  return $this
    ->entityFormBuilder()
    ->getForm($entity_legal_document_version);
}