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

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
eZ\Publish\Core\Repository\SectionService Class Reference

Section service, used for section operations. More...

Inheritance diagram for eZ\Publish\Core\Repository\SectionService:

## Public Member Functions
| __construct (RepositoryInterface $repository, SectionHandler $sectionHandler, LocationHandler $locationHandler, PermissionCriterionResolver $permissionCriterionResolver, array $settings=[])
| Setups service with reference to repository object that created it & corresponding handler. More...
| createSection (SectionCreateStruct $sectionCreateStruct)
| Creates a new Section in the content repository. More...
| updateSection (Section $section, SectionUpdateStruct $sectionUpdateStruct)
| Updates the given section in the content repository. More...
| loadSection ($sectionId)
| Loads a Section from its id ($sectionId). More...
| loadSections ()
| Loads all sections, excluding the ones the current user is not allowed to read. More...
| loadSectionByIdentifier ($sectionIdentifier)
| Loads a Section from its identifier ($sectionIdentifier). More...
| countAssignedContents (Section $section)
| Counts the contents which $section is assigned to. More...
| isSectionUsed (Section $section)
| Returns true if the given section is assigned to contents, or used in role policies, or in role assignments. More...
| assignSection (ContentInfo $contentInfo, Section $section)
| Assigns the content to the given section this method overrides the current assigned section. More...
| deleteSection (Section $section)
| Deletes $section from content repository. More...
| newSectionCreateStruct ()
| Instantiates a new SectionCreateStruct. More...
| newSectionUpdateStruct ()
| Instantiates a new SectionUpdateStruct. More...
Public Member Functions inherited from eZ\Publish\API\Repository\SectionService
| assignSectionToSubtree (Location $location, Section $section)
| Assigns the subtree to the given section this method overrides the current assigned section. More...

## Protected Member Functions
| buildDomainSectionObject (SPISection $spiSection)
| Builds API Section object from provided SPI Section object. More...

## Protected Attributes
| $repository
| $permissionResolver
| $permissionCriterionResolver
| $sectionHandler
| $locationHandler
| $settings

## Detailed Description

Section service, used for section operations.

Definition at line 35 of file Core/Repository/SectionService.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Publish\Core\Repository\SectionService::__construct | ( | RepositoryInterface | $repository,
|  | SectionHandler | $sectionHandler,
|  | LocationHandler | $locationHandler,
|  | PermissionCriterionResolver | $permissionCriterionResolver,
|  | array | $settings = `[]`
| ) |  |

Setups service with reference to repository object that created it & corresponding handler.

Parameters

  \eZ\Publish\API\Repository\Repository | $repository |
  \eZ\Publish\SPI\Persistence\Content\Section\Handler | $sectionHandler |
  \eZ\Publish\SPI\Persistence\Content\Location\Handler | $locationHandler |
  \eZ\Publish\API\Repository\PermissionCriterionResolver | $permissionCriterionResolver |
  array | $settings |

Definition at line 64 of file Core/Repository/SectionService.php.

References eZ\Publish\Core\Repository\SectionService\$locationHandler, eZ\Publish\Core\Repository\SectionService\$permissionCriterionResolver, eZ\Publish\Core\Repository\SectionService\$repository, eZ\Publish\Core\Repository\SectionService\$sectionHandler, and eZ\Publish\Core\Repository\SectionService\$settings.

## Member Function Documentation

## ◆ assignSection()

eZ\Publish\Core\Repository\SectionService::assignSection | ( | ContentInfo | $contentInfo,
|  | Section | $section
| ) |  |

Assigns the content to the given section this method overrides the current assigned section.

Exceptions

Implements eZ\Publish\API\Repository\SectionService.

Definition at line 288 of file Core/Repository/SectionService.php.

References eZ\Publish\Core\Repository\SectionService\loadSection().

## ◆ buildDomainSectionObject()

eZ\Publish\Core\Repository\SectionService::buildDomainSectionObject | ( | SPISection | $spiSection | ) |
| protected

Builds API Section object from provided SPI Section object.

Parameters

  \eZ\Publish\SPI\Persistence\Content\Section | $spiSection |

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

Definition at line 444 of file Core/Repository/SectionService.php.

Referenced by eZ\Publish\Core\Repository\SectionService\createSection(), eZ\Publish\Core\Repository\SectionService\loadSection(), eZ\Publish\Core\Repository\SectionService\loadSectionByIdentifier(), eZ\Publish\Core\Repository\SectionService\loadSections(), and eZ\Publish\Core\Repository\SectionService\updateSection().

## ◆ countAssignedContents()

eZ\Publish\Core\Repository\SectionService::countAssignedContents | ( | Section | $section | ) |

Counts the contents which $section is assigned to.

Parameters

  \eZ\Publish\API\Repository\Values\Content\Section | $section |

Returns
  int

Deprecated:
  since 6.0

Implements eZ\Publish\API\Repository\SectionService.

Definition at line 256 of file Core/Repository/SectionService.php.

## ◆ createSection()

eZ\Publish\Core\Repository\SectionService::createSection | ( | SectionCreateStruct | $sectionCreateStruct | ) |

Creates a new Section in the content repository.

Exceptions

Implements eZ\Publish\API\Repository\SectionService.

Definition at line 87 of file Core/Repository/SectionService.php.

References eZ\Publish\Core\Repository\SectionService\buildDomainSectionObject().

## ◆ deleteSection()

eZ\Publish\Core\Repository\SectionService::deleteSection | ( | Section | $section | ) |

Deletes $section from content repository.

Exceptions

Implements eZ\Publish\API\Repository\SectionService.

Definition at line 391 of file Core/Repository/SectionService.php.

References eZ\Publish\Core\Repository\SectionService\loadSection().

## ◆ isSectionUsed()

eZ\Publish\Core\Repository\SectionService::isSectionUsed | ( | Section | $section | ) |

Returns true if the given section is assigned to contents, or used in role policies, or in role assignments.

This does not check user permissions.

Since
  6.0

Parameters

  \eZ\Publish\API\Repository\Values\Content\Section | $section |

Returns
  bool

Implements eZ\Publish\API\Repository\SectionService.

Definition at line 272 of file Core/Repository/SectionService.php.

## ◆ loadSection()

eZ\Publish\Core\Repository\SectionService::loadSection | ( |  | $sectionId | ) |

Loads a Section from its id ($sectionId).

Exceptions

Implements eZ\Publish\API\Repository\SectionService.

Definition at line 191 of file Core/Repository/SectionService.php.

References eZ\Publish\Core\Repository\SectionService\buildDomainSectionObject().

Referenced by eZ\Publish\Core\Repository\SectionService\assignSection(), and eZ\Publish\Core\Repository\SectionService\deleteSection().

## ◆ loadSectionByIdentifier()

eZ\Publish\Core\Repository\SectionService::loadSectionByIdentifier | ( |  | $sectionIdentifier | ) |

Loads a Section from its identifier ($sectionIdentifier).

Exceptions

Implements eZ\Publish\API\Repository\SectionService.

Definition at line 230 of file Core/Repository/SectionService.php.

References eZ\Publish\Core\Repository\SectionService\buildDomainSectionObject().

## ◆ loadSections()

eZ\Publish\Core\Repository\SectionService::loadSections | ( |  | ) |

Loads all sections, excluding the ones the current user is not allowed to read.

Returns
  \eZ\Publish\API\Repository\Values\Content\Section[]

Implements eZ\Publish\API\Repository\SectionService.

Definition at line 209 of file Core/Repository/SectionService.php.

References eZ\Publish\Core\Repository\SectionService\buildDomainSectionObject().

## ◆ newSectionCreateStruct()

eZ\Publish\Core\Repository\SectionService::newSectionCreateStruct | ( |  | ) |

Instantiates a new SectionCreateStruct.

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

Implements eZ\Publish\API\Repository\SectionService.

Definition at line 422 of file Core/Repository/SectionService.php.

## ◆ newSectionUpdateStruct()

eZ\Publish\Core\Repository\SectionService::newSectionUpdateStruct | ( |  | ) |

Instantiates a new SectionUpdateStruct.

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

Implements eZ\Publish\API\Repository\SectionService.

Definition at line 432 of file Core/Repository/SectionService.php.

## ◆ updateSection()

eZ\Publish\Core\Repository\SectionService::updateSection | ( | Section | $section,
|  | SectionUpdateStruct | $sectionUpdateStruct
| ) |  |

Updates the given section in the content repository.

Exceptions

Implements eZ\Publish\API\Repository\SectionService.

Definition at line 136 of file Core/Repository/SectionService.php.

References eZ\Publish\Core\Repository\SectionService\buildDomainSectionObject().

## Member Data Documentation

## ◆ $locationHandler

eZ\Publish\Core\Repository\SectionService::$locationHandler
| protected

Definition at line 50 of file Core/Repository/SectionService.php.

Referenced by eZ\Publish\Core\Repository\SectionService\__construct().

## ◆ $permissionCriterionResolver

eZ\Publish\Core\Repository\SectionService::$permissionCriterionResolver
| protected

Definition at line 44 of file Core/Repository/SectionService.php.

Referenced by eZ\Publish\Core\Repository\SectionService\__construct().

## ◆ $permissionResolver

eZ\Publish\Core\Repository\SectionService::$permissionResolver
| protected

Definition at line 41 of file Core/Repository/SectionService.php.

## ◆ $repository

eZ\Publish\Core\Repository\SectionService::$repository
| protected

Definition at line 38 of file Core/Repository/SectionService.php.

Referenced by eZ\Publish\Core\Repository\SectionService\__construct().

## ◆ $sectionHandler

eZ\Publish\Core\Repository\SectionService::$sectionHandler
| protected

Definition at line 47 of file Core/Repository/SectionService.php.

Referenced by eZ\Publish\Core\Repository\SectionService\__construct().

## ◆ $settings

eZ\Publish\Core\Repository\SectionService::$settings
| protected

Definition at line 53 of file Core/Repository/SectionService.php.

Referenced by eZ\Publish\Core\Repository\SectionService\__construct().

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

- Core/Repository/SectionService.php

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