You are here

public function LogAddController::addForm in Log entity 8

Presents the creation form for log entities of given bundle/type.

Parameters

EntityInterface $log_type: The custom bundle to add.

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

Return value

array A form array as expected by drupal_render().

1 call to LogAddController::addForm()
LogAddController::add in src/Controller/LogAddController.php
Displays add links for available bundles/types for entity log .

File

src/Controller/LogAddController.php, line 75

Class

LogAddController
Class LogAddController.

Namespace

Drupal\log\Controller

Code

public function addForm(EntityInterface $log_type, Request $request) {
  $entity = $this->storage
    ->create(array(
    'type' => $log_type
      ->id(),
  ));
  return $this
    ->entityFormBuilder()
    ->getForm($entity);
}