src/Factory/ViewFactory.php
public function create(
        Request $request,
        $actionName,
        $adminName,
        AdminConfiguration $adminConfiguration,
        ActionConfiguration $actionConfiguration,
        $entities,
        array $forms = []
    ) {
        if (key_exists('entity', $forms)) {
            $form = $forms['entity'];

            if ($this->shouldRedirect($form, $request, $adminConfiguration)) {
                $routeName = RoutingLoader::generateRouteName(
                    $adminName,
                    'list',
                    $adminConfiguration->getParameter('routing_name_pattern')
                );
                $url = $this->router->generate($routeName);
                $view = new RedirectView(
                    $actionName,
                    $adminName,
                    $actionConfiguration,
                    $adminConfiguration
                );
                $view->setUrl($url);

                return $view;
            }
        }
        $fields = $this
            ->fieldFactory
            ->createFields($actionConfiguration)
        ;
        $formViews = [];

        foreach ($forms as $identifier => $form) {
            $formViews[$identifier] = $form->createView();
        }

        $view = new View(
            $actionName,
            $adminName,
            $actionConfiguration,
            $adminConfiguration,
            $fields,
            $formViews
        );
        $view->setEntities($entities);

        return $view;
    }
public function create(
        Request $request,
        $actionName,
        $adminName,
        AdminConfiguration $adminConfiguration,
        ActionConfiguration $actionConfiguration,
        $entities,
        array $forms = []
    ) {
        if (key_exists('entity', $forms)) {
            $form = $forms['entity'];

            if ($this->shouldRedirect($form, $request, $adminConfiguration)) {
                $routeName = RoutingLoader::generateRouteName(
                    $adminName,
                    'list',
                    $adminConfiguration->getParameter('routing_name_pattern')
                );
                $url = $this->router->generate($routeName);
                $view = new RedirectView(
                    $actionName,
                    $adminName,
                    $actionConfiguration,
                    $adminConfiguration
                );
                $view->setUrl($url);

                return $view;
            }
        }
        $fields = $this
            ->fieldFactory
            ->createFields($actionConfiguration)
        ;
        $formViews = [];

        foreach ($forms as $identifier => $form) {
            $formViews[$identifier] = $form->createView();
        }

        $view = new View(
            $actionName,
            $adminName,
            $actionConfiguration,
            $adminConfiguration,
            $fields,
            $formViews
        );
        $view->setEntities($entities);

        return $view;
    }
public function create ( Request $ request , $ actionName , $ adminName , AdminConfiguration $ adminConfiguration , ActionConfiguration $ actionConfiguration , $ entities , array $ forms = [ ] ) { if ( key_exists ( 'entity' , $ forms ) ) { $ form = $ forms [ 'entity' ] ; if ( $ this -> shouldRedirect ( $ form , $ request , $ adminConfiguration ) ) { $ routeName = RoutingLoader :: generateRouteName ( $ adminName , 'list' , $ adminConfiguration -> getParameter ( 'routing_name_pattern' ) ) ; $ url = $ this -> router -> generate ( $ routeName ) ; $ view = new RedirectView ( $ actionName , $ adminName , $ actionConfiguration , $ adminConfiguration ) ; $ view -> setUrl ( $ url ) ; return $ view ; } } $ fields = $ this -> fieldFactory -> createFields ( $ actionConfiguration ) ; $ formViews = [ ] ; foreach ( $ forms as $ identifier => $ form ) { $ formViews [ $ identifier ] = $ form -> createView ( ) ; } $ view = new View ( $ actionName , $ adminName , $ actionConfiguration , $ adminConfiguration , $ fields , $ formViews ) ; $ view -> setEntities ( $ entities ) ; return $ view ; }
Create a view for a given Admin and Action.

@param Request             $request
@param string              $actionName
@param string              $adminName
@param AdminConfiguration  $adminConfiguration
@param ActionConfiguration $actionConfiguration
@param                     $entities
@param FormInterface[]     $forms

@return ViewInterface
Create a view for a given Admin and Action .