This repository has been archived on 2022-07-12. You can view files and clone it, but cannot push or open issues or pull requests.
opencase/modules/opencase_reporting/src/Plugin/Block/ReportForm.php

27 lines
515 B
PHP

<?php
namespace Drupal\opencase_reporting\Plugin\Block;
use Drupal\Core\Block\BlockBase;
/**
* Provides a 'ReportForm' block.
*
* @Block(
* id = "opencase_report_form",
* admin_label = @Translation("Report form"),
* )
*/
class ReportForm extends BlockBase {
/**
* {@inheritdoc}
*/
public function build() {
$report = \Drupal::entityManager()->getStorage('opencase_report')->create();
$form = \Drupal::service('entity.form_builder')->getForm($report, 'add');
return $form;
}
}