/** * Is the business entity type allowed for the widget and the view context * * @param string $formEntityName The business entity name * @param View $view The view * * @return boolean Does the form allows this kind of business entity in this view */ public function isBusinessEntityAllowed($formEntityName, View $view) { //the result $isBusinessEntityAllowed = false; if ($view instanceof BusinessEntityPagePattern || $view instanceof BusinessEntityPage) { //are we using the same business entity if ($formEntityName === $view->getBusinessEntityName()) { $isBusinessEntityAllowed = true; } } return $isBusinessEntityAllowed; }