Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Public Member Functions | Private Member Functions | Private Attributes | List of all members
eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder Class Reference

Builds ContentView objects. More...

Inheritance diagram for eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder:

## Public Member Functions
| __construct (Repository $repository, Configurator $viewConfigurator, ParametersInjector $viewParametersInjector, RequestStack $requestStack, ContentInfoLocationLoader $locationLoader=null)
| matches ($argument)
| Tests if the builder matches the given argument. More...
| buildView (array $parameters)

## Private Member Functions
| loadContent ($contentId)
| Loads Content with id $contentId. More...
| loadEmbeddedContent ($contentId, Location $location=null)
| Loads the embedded content with id $contentId. More...
| loadLocation ($locationId)
| Loads a visible Location. More...
| canRead (Content $content, Location $location=null, bool $isEmbed=true)
| Checks if a user can read a content, or view it as an embed. More...
| isEmbed ($parameters)
| Checks if the view is an embed one. More...

## Private Attributes
| $repository
| $permissionResolver
| $viewConfigurator
| $viewParametersInjector
| $requestStack
| $defaultTemplates
| $locationLoader

## Detailed Description

Builds ContentView objects.

Definition at line 29 of file ContentViewBuilder.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder::__construct | ( | Repository | $repository,
|  | Configurator | $viewConfigurator,
|  | ParametersInjector | $viewParametersInjector,
|  | RequestStack | $requestStack,
|  | ContentInfoLocationLoader | $locationLoader = `null`
| ) |  |

Definition at line 56 of file ContentViewBuilder.php.

References eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder\$locationLoader, eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder\$repository, eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder\$requestStack, eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder\$viewConfigurator, and eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder\$viewParametersInjector.

## Member Function Documentation

## ◆ buildView()

eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder::buildView | ( | array | $parameters | ) |

Parameters

  array | $parameters |

Returns
  \eZ\Publish\Core\MVC\Symfony\View\ContentView|\eZ\Publish\Core\MVC\Symfony\View\View If both contentId and locationId parameters are missing

Exceptions

Implements eZ\Publish\Core\MVC\Symfony\View\Builder\ViewBuilder.

Definition at line 86 of file ContentViewBuilder.php.

References eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder\canRead(), eZ\Publish\Core\MVC\Symfony\View\EmbedView\DEFAULT_VIEW_TYPE, eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder\isEmbed(), eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder\loadContent(), eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder\loadEmbeddedContent(), and eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder\loadLocation().

## ◆ canRead()

eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder::canRead | ( | Content | $content,
|  | Location | $location = `null`,
|  | bool | $isEmbed = `true`
| ) |  |
| private

Checks if a user can read a content, or view it as an embed.

Parameters

  \eZ\Publish\API\Repository\Values\Content\Content | $content |
  \eZ\Publish\API\Repository\Values\Content\Location | $location |
  bool | $isEmbed |

Returns
  bool

Definition at line 257 of file ContentViewBuilder.php.

Referenced by eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder\buildView(), and eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder\loadEmbeddedContent().

## ◆ isEmbed()

eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder::isEmbed | ( |  | $parameters | ) |
| private

Checks if the view is an embed one.

Uses either the controller action (embedAction), or the viewType (embed/embed-inline).

Parameters

  array | $parameters | The ViewBuilder parameters array.

Returns
  bool

Definition at line 274 of file ContentViewBuilder.php.

Referenced by eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder\buildView().

## ◆ loadContent()

eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder::loadContent | ( |  | $contentId | ) |
| private

Loads Content with id $contentId.

Parameters

  mixed | $contentId |

Returns
  \eZ\Publish\API\Repository\Values\Content\Content

Exceptions

Definition at line 180 of file ContentViewBuilder.php.

Referenced by eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder\buildView(), and eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder\loadEmbeddedContent().

## ◆ loadEmbeddedContent()

eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder::loadEmbeddedContent | ( |  | $contentId,
|  | Location | $location = `null`
| ) |  |
| private

Loads the embedded content with id $contentId.

Will load the content with sudo(), and check if the user can view_embed this content, for the given location if provided.

Parameters

  mixed | $contentId |
  \eZ\Publish\API\Repository\Values\Content\Location | $location |

Returns
  \eZ\Publish\API\Repository\Values\Content\Content

Exceptions

Definition at line 197 of file ContentViewBuilder.php.

References eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder\$repository, eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder\canRead(), eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder\loadContent(), and eZ\Publish\API\Repository\Values\Content\VersionInfo\STATUS_PUBLISHED.

Referenced by eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder\buildView().

## ◆ loadLocation()

eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder::loadLocation | ( |  | $locationId | ) |
| private

Loads a visible Location.

Parameters

  $locationId |

Returns
  \eZ\Publish\API\Repository\Values\Content\Location

Definition at line 230 of file ContentViewBuilder.php.

References eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder\$repository, and eZ\Publish\Core\MVC\Symfony\Controller\Content\PreviewController\PREVIEW_PARAMETER_NAME.

Referenced by eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder\buildView().

## ◆ matches()

eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder::matches | ( |  | $argument | ) |

Tests if the builder matches the given argument.

Parameters

  mixed | $argument | Anything the builder can decide against. Example: a controller's request string.

Returns
  bool true if the ViewBuilder matches the argument, false otherwise.

Implements eZ\Publish\Core\MVC\Symfony\View\Builder\ViewBuilder.

Definition at line 71 of file ContentViewBuilder.php.

## Member Data Documentation

## ◆ $defaultTemplates

eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder::$defaultTemplates
| private

Definition at line 51 of file ContentViewBuilder.php.

## ◆ $locationLoader

eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder::$locationLoader
| private

Definition at line 54 of file ContentViewBuilder.php.

Referenced by eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder\__construct().

## ◆ $permissionResolver

eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder::$permissionResolver
| private

Definition at line 35 of file ContentViewBuilder.php.

## ◆ $repository

eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder::$repository
| private

Definition at line 32 of file ContentViewBuilder.php.

Referenced by eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder\__construct(), eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder\loadEmbeddedContent(), and eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder\loadLocation().

## ◆ $requestStack

eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder::$requestStack
| private

Definition at line 44 of file ContentViewBuilder.php.

Referenced by eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder\__construct().

## ◆ $viewConfigurator

eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder::$viewConfigurator
| private

Definition at line 38 of file ContentViewBuilder.php.

Referenced by eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder\__construct().

## ◆ $viewParametersInjector

eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder::$viewParametersInjector
| private

Definition at line 41 of file ContentViewBuilder.php.

Referenced by eZ\Publish\Core\MVC\Symfony\View\Builder\ContentViewBuilder\__construct().

The documentation for this class was generated from the following file:

- ContentViewBuilder.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.