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

Public Member Functions | Protected Member Functions | List of all members
eZ\Publish\Core\REST\Server\Controller\Content Class Reference

Content controller. More...

Inheritance diagram for eZ\Publish\Core\REST\Server\Controller\Content:

## Public Member Functions
| redirectContent (Request $request)
| Loads a content info by remote ID. More...
| loadContent ($contentId, Request $request)
| Loads a content info, potentially with the current version embedded. More...
| updateContentMetadata ($contentId, Request $request)
| Updates a content's metadata. More...
| redirectCurrentVersion ($contentId)
| Loads a specific version of a given content object. More...
| loadContentInVersion ($contentId, $versionNumber, Request $request)
| Loads a specific version of a given content object. More...
| createContent (Request $request)
| Creates a new content draft assigned to the authenticated user. More...
| deleteContent ($contentId)
| The content is deleted. More...
| copyContent ($contentId, Request $request)
| Creates a new content object as copy under the given parent location given in the destination header. More...
| deleteContentTranslation ($contentId, $languageCode)
| Deletes a translation from all the Versions of the given Content Object. More...
| loadContentVersions ($contentId, Request $request)
| Returns a list of all versions of the content. More...
| deleteContentVersion ($contentId, $versionNumber)
| The version is deleted. More...
| deleteTranslationFromDraft ($contentId, $versionNumber, $languageCode)
| Remove the given Translation from the given Version Draft. More...
| createDraftFromVersion ($contentId, $versionNumber)
| The system creates a new draft version as a copy from the given version. More...
| createDraftFromCurrentVersion ($contentId)
| The system creates a new draft version as a copy from the current version. More...
| updateVersion ($contentId, $versionNumber, Request $request)
| A specific draft is updated. More...
| publishVersion ($contentId, $versionNumber)
| The content version is published. More...
| redirectCurrentVersionRelations ($contentId)
| Redirects to the relations of the current version. More...
| loadVersionRelations ($contentId, $versionNumber, Request $request)
| Loads the relations of the given version. More...
| loadVersionRelation ($contentId, $versionNumber, $relationId, Request $request)
| Loads a relation for the given content object and version. More...
| removeRelation ($contentId, $versionNumber, $relationId, Request $request)
| Deletes a relation of the given draft. More...
| createRelation ($contentId, $versionNumber, Request $request)
| Creates a new relation of type COMMON for the given draft. More...
| hideContent (int $contentId)
| revealContent (int $contentId)
| createView ()
| Creates and executes a content view. More...
Public Member Functions inherited from eZ\Publish\Core\REST\Server\Controller
| setInputDispatcher (InputDispatcher $inputDispatcher)
| setRouter (RouterInterface $router)
| setRepository (Repository $repository)
| setRequestParser (RequestParser $requestParser)

## Protected Member Functions
| forward ($controller)
| parseContentRequest (Request $request)
| doCreateContent (Request $request, RestContentCreateStruct $contentCreate)
Protected Member Functions inherited from eZ\Publish\Core\REST\Server\Controller
| getMediaType (Request $request)
| Extracts the requested media type from $request. More...

## Additional Inherited Members
Protected Attributes inherited from eZ\Publish\Core\REST\Server\Controller
| $inputDispatcher
| $router
| $requestParser
| $repository

## Detailed Description

Content controller.

Definition at line 29 of file Publish/Core/REST/Server/Controller/Content.php.

## Member Function Documentation

## ◆ copyContent()

eZ\Publish\Core\REST\Server\Controller\Content::copyContent | ( |  | $contentId,
|  | Request | $request
| ) |  |

Creates a new content object as copy under the given parent location given in the destination header.

Parameters

  mixed | $contentId |

Returns
  \eZ\Publish\Core\REST\Server\Values\ResourceCreated

Definition at line 265 of file Publish/Core/REST/Server/Controller/Content.php.

## ◆ createContent()

eZ\Publish\Core\REST\Server\Controller\Content::createContent | ( | Request | $request | ) |

Creates a new content draft assigned to the authenticated user.

If a different userId is given in the input it is assigned to the given user but this required special rights for the authenticated user (this is useful for content staging where the transfer process does not have to authenticate with the user which created the content object in the source server). The user has to publish the content if it should be visible.

Parameters

  \Symfony\Component\HttpFoundation\Request | $request |

Returns
  \eZ\Publish\Core\REST\Server\Values\CreatedContent

Definition at line 234 of file Publish/Core/REST/Server/Controller/Content.php.

References eZ\Publish\Core\REST\Server\Controller\Content\doCreateContent(), and eZ\Publish\Core\REST\Server\Controller\Content\parseContentRequest().

## ◆ createDraftFromCurrentVersion()

eZ\Publish\Core\REST\Server\Controller\Content::createDraftFromCurrentVersion | ( |  | $contentId | ) |

The system creates a new draft version as a copy from the current version.

Parameters

  mixed | $contentId |

Exceptions

  ForbiddenException | if the current version is already a draft

Returns
  \eZ\Publish\Core\REST\Server\Values\CreatedVersion

Definition at line 424 of file Publish/Core/REST/Server/Controller/Content.php.

## ◆ createDraftFromVersion()

eZ\Publish\Core\REST\Server\Controller\Content::createDraftFromVersion | ( |  | $contentId,
|  |  | $versionNumber
| ) |  |

The system creates a new draft version as a copy from the given version.

Parameters

  mixed | $contentId |
  mixed | $versionNumber |

Returns
  \eZ\Publish\Core\REST\Server\Values\CreatedVersion

Definition at line 395 of file Publish/Core/REST/Server/Controller/Content.php.

## ◆ createRelation()

eZ\Publish\Core\REST\Server\Controller\Content::createRelation | ( |  | $contentId,
|  |  | $versionNumber,
|  | Request | $request
| ) |  |

Creates a new relation of type COMMON for the given draft.

Parameters

  mixed | $contentId |
  int | $versionNumber |

Exceptions

  ForbiddenException | if version $versionNumber isn't a draft
  ForbiddenException | if a relation to the same content already exists

Returns
  \eZ\Publish\Core\REST\Server\Values\CreatedRelation

Definition at line 695 of file Publish/Core/REST/Server/Controller/Content.php.

## ◆ createView()

eZ\Publish\Core\REST\Server\Controller\Content::createView | ( |  | ) |

Creates and executes a content view.

Deprecated:
  Since platform 1.0. Forwards the request to the new /views location, but returns a 301.

Returns
  \eZ\Publish\Core\REST\Server\Values\RestExecutedView

Definition at line 773 of file Publish/Core/REST/Server/Controller/Content.php.

References eZ\Publish\Core\REST\Server\Controller\Content\forward().

## ◆ deleteContent()

eZ\Publish\Core\REST\Server\Controller\Content::deleteContent | ( |  | $contentId | ) |

The content is deleted.

If the content has locations (which is required in 4.x) on delete all locations assigned the content object are deleted via delete subtree.

Parameters

  mixed | $contentId |

Returns
  \eZ\Publish\Core\REST\Server\Values\NoContent

Definition at line 249 of file Publish/Core/REST/Server/Controller/Content.php.

## ◆ deleteContentTranslation()

eZ\Publish\Core\REST\Server\Controller\Content::deleteContentTranslation | ( |  | $contentId,
|  |  | $languageCode
| ) |  |

Deletes a translation from all the Versions of the given Content Object.

If any non-published Version contains only the Translation to be deleted, that entire Version will be deleted

Parameters

  int | $contentId |
  string | $languageCode |

Returns
  \eZ\Publish\Core\REST\Server\Values\NoContent

Exceptions

Definition at line 295 of file Publish/Core/REST/Server/Controller/Content.php.

## ◆ deleteContentVersion()

eZ\Publish\Core\REST\Server\Controller\Content::deleteContentVersion | ( |  | $contentId,
|  |  | $versionNumber
| ) |  |

The version is deleted.

Parameters

  mixed | $contentId |
  mixed | $versionNumber |

Exceptions

Definition at line 344 of file Publish/Core/REST/Server/Controller/Content.php.

## ◆ deleteTranslationFromDraft()

eZ\Publish\Core\REST\Server\Controller\Content::deleteTranslationFromDraft | ( |  | $contentId,
|  |  | $versionNumber,
|  |  | $languageCode
| ) |  |

Remove the given Translation from the given Version Draft.

Parameters

  int | $contentId |
  int | $versionNumber |
  string | $languageCode |

Returns
  \eZ\Publish\Core\REST\Server\Values\NoContent

Exceptions

Definition at line 373 of file Publish/Core/REST/Server/Controller/Content.php.

## ◆ doCreateContent()

eZ\Publish\Core\REST\Server\Controller\Content::doCreateContent | ( | Request | $request,
|  | RestContentCreateStruct | $contentCreate
| ) |  |
| protected

Parameters

  \Symfony\Component\HttpFoundation\Request | $request |
  \eZ\Publish\Core\REST\Server\Values\RestContentCreateStruct | $contentCreate |

Exceptions

Definition at line 822 of file Publish/Core/REST/Server/Controller/Content.php.

References eZ\Publish\Core\REST\Server\Controller\getMediaType().

Referenced by eZ\Publish\Core\REST\Server\Controller\Content\createContent().

## ◆ forward()

eZ\Publish\Core\REST\Server\Controller\Content::forward | ( |  | $controller | ) |
| protected

Parameters

  string | $controller |

Returns
  \Symfony\Component\HttpFoundation\Response

Definition at line 789 of file Publish/Core/REST/Server/Controller/Content.php.

Referenced by eZ\Publish\Core\REST\Server\Controller\Content\createView().

## ◆ hideContent()

eZ\Publish\Core\REST\Server\Controller\Content::hideContent | ( | int | $contentId | ) |

Parameters

  int | $contentId |

Returns
  \eZ\Publish\Core\REST\Server\Values\NoContent

Exceptions

Definition at line 740 of file Publish/Core/REST/Server/Controller/Content.php.

## ◆ loadContent()

eZ\Publish\Core\REST\Server\Controller\Content::loadContent | ( |  | $contentId,
|  | Request | $request
| ) |  |

Loads a content info, potentially with the current version embedded.

Parameters

  mixed | $contentId |
  \Symfony\Component\HttpFoundation\Request | $request |

Returns
  \eZ\Publish\Core\REST\Server\Values\RestContent

Definition at line 66 of file Publish/Core/REST/Server/Controller/Content.php.

References eZ\Publish\Core\REST\Server\Controller\getMediaType().

## ◆ loadContentInVersion()

eZ\Publish\Core\REST\Server\Controller\Content::loadContentInVersion | ( |  | $contentId,
|  |  | $versionNumber,
|  | Request | $request
| ) |  |

Loads a specific version of a given content object.

Parameters

  mixed | $contentId |
  int | $versionNumber |

Returns
  \eZ\Publish\Core\REST\Server\Values\Version

Definition at line 188 of file Publish/Core/REST/Server/Controller/Content.php.

References eZ\Publish\SPI\Persistence\Content\VersionInfo\STATUS_DRAFT.

## ◆ loadContentVersions()

eZ\Publish\Core\REST\Server\Controller\Content::loadContentVersions | ( |  | $contentId,
|  | Request | $request
| ) |  |

Returns a list of all versions of the content.

This method does not include fields and relations in the Version elements of the response.

Parameters

  mixed | $contentId |

Returns
  \eZ\Publish\Core\REST\Server\Values\VersionList

Definition at line 324 of file Publish/Core/REST/Server/Controller/Content.php.

## ◆ loadVersionRelation()

eZ\Publish\Core\REST\Server\Controller\Content::loadVersionRelation | ( |  | $contentId,
|  |  | $versionNumber,
|  |  | $relationId,
|  | Request | $request
| ) |  |

Loads a relation for the given content object and version.

Parameters

  mixed | $contentId |
  int | $versionNumber |
  mixed | $relationId |

Exceptions

Definition at line 620 of file Publish/Core/REST/Server/Controller/Content.php.

## ◆ loadVersionRelations()

eZ\Publish\Core\REST\Server\Controller\Content::loadVersionRelations | ( |  | $contentId,
|  |  | $versionNumber,
|  | Request | $request
| ) |  |

Loads the relations of the given version.

Parameters

  mixed | $contentId |
  mixed | $versionNumber |

Returns
  \eZ\Publish\Core\REST\Server\Values\RelationList

Definition at line 576 of file Publish/Core/REST/Server/Controller/Content.php.

## ◆ parseContentRequest()

eZ\Publish\Core\REST\Server\Controller\Content::parseContentRequest | ( | Request | $request | ) |
| protected

Parameters

  \Symfony\Component\HttpFoundation\Request | $request |

Returns
  mixed

Definition at line 802 of file Publish/Core/REST/Server/Controller/Content.php.

Referenced by eZ\Publish\Core\REST\Server\Controller\Content\createContent().

## ◆ publishVersion()

eZ\Publish\Core\REST\Server\Controller\Content::publishVersion | ( |  | $contentId,
|  |  | $versionNumber
| ) |  |

The content version is published.

Parameters

  mixed | $contentId |
  mixed | $versionNumber |

Exceptions

  ForbiddenException | if version $versionNumber isn't a draft

Returns
  \eZ\Publish\Core\REST\Server\Values\NoContent

Definition at line 528 of file Publish/Core/REST/Server/Controller/Content.php.

## ◆ redirectContent()

eZ\Publish\Core\REST\Server\Controller\Content::redirectContent | ( | Request | $request | ) |

Loads a content info by remote ID.

Exceptions

Definition at line 38 of file Publish/Core/REST/Server/Controller/Content.php.

## ◆ redirectCurrentVersion()

eZ\Publish\Core\REST\Server\Controller\Content::redirectCurrentVersion | ( |  | $contentId | ) |

Loads a specific version of a given content object.

Parameters

  mixed | $contentId |

Returns
  \eZ\Publish\Core\REST\Server\Values\TemporaryRedirect

Definition at line 165 of file Publish/Core/REST/Server/Controller/Content.php.

## ◆ redirectCurrentVersionRelations()

eZ\Publish\Core\REST\Server\Controller\Content::redirectCurrentVersionRelations | ( |  | $contentId | ) |

Redirects to the relations of the current version.

Parameters

  mixed | $contentId |

Returns
  \eZ\Publish\Core\REST\Server\Values\TemporaryRedirect

Definition at line 553 of file Publish/Core/REST/Server/Controller/Content.php.

## ◆ removeRelation()

eZ\Publish\Core\REST\Server\Controller\Content::removeRelation | ( |  | $contentId,
|  |  | $versionNumber,
|  |  | $relationId,
|  | Request | $request
| ) |  |

Deletes a relation of the given draft.

Parameters

  mixed | $contentId |
  int | $versionNumber |
  mixed | $relationId |

Exceptions

Definition at line 657 of file Publish/Core/REST/Server/Controller/Content.php.

## ◆ revealContent()

eZ\Publish\Core\REST\Server\Controller\Content::revealContent | ( | int | $contentId | ) |

Parameters

  int | $contentId |

Returns
  \eZ\Publish\Core\REST\Server\Values\NoContent

Exceptions

Definition at line 757 of file Publish/Core/REST/Server/Controller/Content.php.

## ◆ updateContentMetadata()

eZ\Publish\Core\REST\Server\Controller\Content::updateContentMetadata | ( |  | $contentId,
|  | Request | $request
| ) |  |

Updates a content's metadata.

Parameters

  mixed | $contentId |

Returns
  \eZ\Publish\Core\REST\Server\Values\RestContent

Definition at line 115 of file Publish/Core/REST/Server/Controller/Content.php.

## ◆ updateVersion()

eZ\Publish\Core\REST\Server\Controller\Content::updateVersion | ( |  | $contentId,
|  |  | $versionNumber,
|  | Request | $request
| ) |  |

A specific draft is updated.

Parameters

  mixed | $contentId |
  mixed | $versionNumber |

Exceptions

Definition at line 460 of file Publish/Core/REST/Server/Controller/Content.php.

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

- Publish/Core/REST/Server/Controller/Content.php

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