@param int $locationId
@param string $viewType
@param bool|false $layout
@param array $params

@return \Symfony\Component\HttpFoundation\Response
511292
public function showFeedbackFormAction($locationId, $viewType, $layout = false, array $params = array())
    {
        $feedback = new Feedback();

        $form = $this->getFeedbackFormProvider()->getFeedbackForm($feedback);

        return $this->get('ez_content')->viewLocation(
            $locationId,
            $viewType,
            $layout,
            $params + array('form' => $form->createView(), 'onlyMarkup' => true, 'onlyJavascript' => false)
        );
    }
1330217
<T> void bindWith(final PeasyRecyclerView<T> binder, final int viewType) {
        this.itemView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                int position = getLayoutPosition();
                position = (position <= binder.getLastItemIndex()) ? position : getAdapterPosition();
                position = (position <= binder.getLastItemIndex()) ? position : RecyclerView.NO_POSITION;
                if (position != RecyclerView.NO_POSITION) {
                    binder.onItemClick(v, viewType, position, binder.getItem(position), getInstance());
                }
            }
        });
        this.itemView.setOnLongClickListener(new View.OnLongClickListener() {
            @Override
            public boolean onLongClick(View v) {
                int position = getLayoutPosition();
                position = (position <= binder.getLastItemIndex()) ? position : getAdapterPosition();
                position = (position <= binder.getLastItemIndex()) ? position : RecyclerView.NO_POSITION;
                if (getLayoutPosition() != RecyclerView.NO_POSITION) {
                    return binder.onItemLongClick(v, viewType, position, binder.getItem(position), getInstance());
                }
                return false;
            }
        });
    }
199097
@Nullable static View getView(Context context, int resourceId, View view) {
    LayoutInflater inflater = LayoutInflater.from(context);
    if (view != null) {
      return view;
    }
    if (resourceId != INVALID) {
      view = inflater.inflate(resourceId, null);
    }
    return view;
  }
88410
public function usesCustomController(Content $content, Location $location, $viewMode = 'full')
    {
        $contentView = new ContentView(null, [], $viewMode);
        $contentView->setContent($content);
        $contentView->setLocation($location);

        foreach ($this->viewProviders as $viewProvider) {
            $view = $viewProvider->getView($contentView);
            if ($view instanceof View) {
                if ($view->getControllerReference() !== null) {
                    return true;
                }
            }
        }

        return false;
    }
409276
public function watchWithLayout($view, $args = array(), $type = null)
    {
        try {
            return $this->scopeWithLayout($view, $args, $type);
        } catch (\InvalidArgumentException $e) {
            return $this->ofWithLayout($view, $args, $type);
        }
    }
442273
public function createView($viewType)
    {
        if (class_exists($viewType)) {
            $reflectionClass = new \ReflectionClass($viewType);

            if ($reflectionClass->implementsInterface(AjaxViewInterface::class)) {
                return $reflectionClass->newInstance();
            }
        }

        throw new AjaxModalsException("View type $viewType does not exists.");
    }
938189
public function admin_modal_bail_post_redirect( $location, $post_id ) {

		if ( ! pods_is_modal_window() ) {
			return $location;
		}

		$post_title = get_the_title( $post_id );

		$field_args = (object) array(
			'options' => array(
				'pick_object' => 'post_type',
				'pick_val'    => get_post_type( $post_id ),
			),
			'value'   => array(
				$post_id => $post_title,
			),
		);

		$this->admin_modal_bail( $post_id, $post_title, $field_args );

		return $location;

	}
427142
public function createWidget($mode, $type, $slotId, View $view, $entity, $position, $widgetReference, $quantum)
    {
        //services
        $formErrorHelper = $this->formErrorHelper;
        $request = $this->getRequest();

        if ($view instanceof VirtualBusinessPage) {
            $this->virtualToBpTransformer->transform($view);
        }
        //create a new widget
        $widget = $this->widgetHelper->newWidgetInstance($type, $view, $slotId, $mode);

        $form = $this->widgetFormBuilder->callBuildFormSwitchParameters($widget, $view, $entity, $position, $widgetReference, $slotId, $quantum);

        $noValidate = $request->query->get('novalidate', false);

        $form->handleRequest($request);
        if ($noValidate === false && $form->isValid()) {
            if (!$view->getId()) {
                //create a view for the business entity instance if we are currently on a virtual one
                $this->entityManager->persist($view);
            }

            //get the widget from the form
            $widget = $form->getData();

            //update fields of the widget
            $widget->setBusinessEntityId($entity);

            //persist the widget
            $this->entityManager->persist($widget);
            $this->entityManager->flush();

            $this->widgetMapManager->insert($widget, $view, $slotId, $position, $widgetReference);

            $this->entityManager->persist($view);
            $this->entityManager->flush();

            $widget->setCurrentView($view);

            $event = new WidgetFlushedEvent($widget);
            $this->eventDispatcher->dispatch(VictoireCmsEvents::WIDGET_POST_FLUSH, $event);
            $this->eventDispatcher->dispatch(VictoireCmsEvents::WIDGET_POST_FLUSH.'_'.strtoupper($type), $event);

            $this->widgetMapBuilder->build($view);

            //get the html for the widget
            $htmlWidget = $this->widgetRenderer->renderContainer($widget, $view);

            $response = [
                'success'  => true,
                'widgetId' => $widget->getId(),
                'html'     => $htmlWidget,
            ];
        } else {
            //get the errors as a string
            $response = [
                'success' => false,
                'message' => $noValidate === false ? $formErrorHelper->getRecursiveReadableErrors($form) : null,
                'html'    => $this->widgetFormBuilder->renderNewForm($form, $widget, $slotId, $view, $quantum, $entity),
            ];
        }

        return $response;
    }
1067823
public function validateChangeLayoutType(Layout $layout, LayoutTypeInterface $targetLayoutType, array $zoneMappings, bool $preserveSharedZones = true): void
    {
        $seenZones = [];
        foreach ($zoneMappings as $newZone => $oldZones) {
            if (!$targetLayoutType->hasZone($newZone)) {
                throw ValidationException::validationFailed(
                    'zoneMappings',
                    sprintf(
                        'Zone "%s" does not exist in "%s" layout type.',
                        $newZone,
                        $targetLayoutType->getIdentifier()
                    )
                );
            }

            if (!is_array($oldZones)) {
                throw ValidationException::validationFailed(
                    'zoneMappings',
                    sprintf(
                        'The list of mapped zones for "%s" zone must be an array.',
                        $newZone
                    )
                );
            }

            $oldLayoutZones = [];

            foreach ($oldZones as $oldZone) {
                if (in_array($oldZone, $seenZones, true)) {
                    throw ValidationException::validationFailed(
                        'zoneMappings',
                        sprintf(
                            'Zone "%s" is specified more than once.',
                            $oldZone
                        )
                    );
                }

                $seenZones[] = $oldZone;
                $oldLayoutZones[] = $layout->getZone($oldZone);
            }

            if ($preserveSharedZones && count($oldLayoutZones) > 1) {
                foreach ($oldLayoutZones as $oldZone) {
                    if ($oldZone->getLinkedZone() instanceof Zone) {
                        throw ValidationException::validationFailed(
                            'zoneMappings',
                            sprintf(
                                'When preserving shared layout zones, mapping for zone "%s" needs to be 1:1.',
                                $newZone
                            )
                        );
                    }
                }
            }
        }
    }
28207
public static TypeAnnotationPosition
        methodTypeParameter(final List<TypePathEntry> location,
                            final int parameter_index) {
        return methodTypeParameter(location, null, parameter_index, -1);
    }
1262918
public function renderItem(array $context, CmsItemInterface $item, string $viewType, array $parameters = [], ?string $viewContext = null): string
    {
        try {
            return $this->renderer->renderValue(
                $item,
                $this->getViewContext($context, $viewContext),
                ['view_type' => $viewType] + $parameters
            );
        } catch (Throwable $t) {
            $message = sprintf(
                'Error rendering an item with value "%s" and value type "%s"',
                $item->getValue(),
                $item->getValueType()
            );

            $this->errorHandler->handleError($t, $message);
        }

        return '';
    }
857951
public function update(UpdateStruct $location, $locationId)
    {
        try {
            return $this->innerGateway->update($location, $locationId);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
970670
public function partialComposer($view, $callback, $layout = null)
    {
        if (! is_array($view)) {
            $view = array($view);
        }

        // Partial path with namespace.
        $path = $this->getThemeNamespace('partials');

        // This code support partialWithLayout.
        if (! is_null($layout)) {
            $path = $path.'.'.$layout;
        }

        $view = array_map(function($v) use ($path) {
            return $path.'.'.$v;
        }, $view);

        $this->view->composer($view, $callback);
    }
669548
public function loadContentInfoByLocationId($locationId)
    {
        try {
            return $this->innerGateway->loadContentInfoByLocationId($locationId);
        } catch (DBALException $e) {
            throw new \RuntimeException('Database error', 0, $e);
        } catch (\PDOException $e) {
            throw new \RuntimeException('Database error', 0, $e);
        }
    }
66217
private function createCustomUrlRemoveForm(Location $location, array $customUrlAliases): FormInterface
    {
        $customUrlRemoveData = new CustomUrlRemoveData($location, $this->getChoices($customUrlAliases));

        return $this->formFactory->removeCustomUrl($customUrlRemoveData);
    }
117258
private function createLocationAddForm(Location $location): FormInterface
    {
        return $this->formFactory->addLocation(
            new ContentLocationAddData($location->getContentInfo())
        );
    }
121191
private function getSearchQuery(Location $parentLocation): LocationQuery
    {
        $searchQuery = new LocationQuery();
        $searchQuery->filter = new Criterion\ParentLocationId($parentLocation->id);

        $contentTypeCriterion = null;

        if (!empty($this->allowedContentTypes)) {
            $contentTypeCriterion = new Criterion\ContentTypeIdentifier($this->allowedContentTypes);
        }

        if (empty($this->allowedContentTypes) && !empty($this->ignoredContentTypes)) {
            $contentTypeCriterion = new Criterion\LogicalNot(
                new Criterion\ContentTypeIdentifier($this->ignoredContentTypes)
            );
        }

        if (null !== $contentTypeCriterion) {
            $searchQuery->filter = new Criterion\LogicalAnd([$searchQuery->filter, $contentTypeCriterion]);
        }

        return $searchQuery;
    }