Section service, used for section operations.
Methods
Assigns the content to the given section this method overrides the current assigned section.
Parameters
Tags
-
Throws
-
UnauthorizedException
If user does not have access to view provided object
Assigns the subtree to the given section this method overrides the current assigned section.
Parameters
Name |
Type |
Default value |
Description |
$location
|
Location
|
-
|
-
|
$section
|
Section
|
-
|
-
|
Counts the contents which $section is assigned to.
|
public countAssignedContents(Section $section) : int
|
Parameters
Name |
Type |
Default value |
Description |
$section
|
Section
|
-
|
-
|
Return values
int
Tags
-
Deprecated
-
Creates the a new Section in the content repository.
Parameters
Return values
Section
Tags
-
Throws
-
UnauthorizedException
If the current user user is not allowed to create a section
-
Throws
-
InvalidArgumentException
If the new identifier in $sectionCreateStruct already exists
Deletes $section from content repository.
|
public deleteSection(Section $section) : void
|
Parameters
Name |
Type |
Default value |
Description |
$section
|
Section
|
-
|
-
|
Tags
-
Throws
-
NotFoundException
If the specified section is not found
-
Throws
-
UnauthorizedException
If the current user user is not allowed to delete a section
-
Throws
-
BadStateException
if section can not be deleted
because it is still assigned to some contents.
Returns true if the given section is assigned to contents, or used in role policies, or in role assignments.
|
public isSectionUsed(Section $section) : bool
|
This does not check user permissions.
Parameters
Name |
Type |
Default value |
Description |
$section
|
Section
|
-
|
-
|
Return values
bool
Loads a Section from its id ($sectionId).
|
public loadSection(int $sectionId) : Section
|
Parameters
Name |
Type |
Default value |
Description |
$sectionId
|
int
|
-
|
-
|
Return values
Section
Tags
-
Throws
-
NotFoundException
if section could not be found
-
Throws
-
UnauthorizedException
If the current user user is not allowed to read a section
Loads a Section from its identifier ($sectionIdentifier).
|
public loadSectionByIdentifier(string $sectionIdentifier) : Section
|
Parameters
Name |
Type |
Default value |
Description |
$sectionIdentifier
|
string
|
-
|
-
|
Return values
Section
Tags
-
Throws
-
NotFoundException
if section could not be found
-
Throws
-
UnauthorizedException
If the current user user is not allowed to read a section
Loads all sections, excluding the ones the current user is not allowed to read.
|
public loadSections() : array<string|int, Section>
|
Return values
array<string|int, Section>
Instantiates a new SectionCreateStruct.
Return values
SectionCreateStruct
Instantiates a new SectionUpdateStruct.
Return values
SectionUpdateStruct
Updates the given in the content repository.
Parameters
Return values
Section
Tags
-
Throws
-
UnauthorizedException
If the current user user is not allowed to create a section
-
Throws
-
InvalidArgumentException
If the new identifier already exists (if set in the update struct)