public function WebformAnalysis::__construct in Webform Analysis 8
Construct.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The entity of form.
File
- src/
WebformAnalysis.php, line 26
Class
- WebformAnalysis
- WebformAnalysis.
Namespace
Drupal\webform_analysisCode
public function __construct(EntityInterface $entity) {
if ($entity instanceof WebformInterface) {
$this->webform = $entity;
$this->entity = NULL;
}
else {
$this->entity = $entity;
$this->webform = $entity->webform->entity;
}
}