Interface

eZ\Publish\API\Repository\SectionService

interface SectionService

Section service, used for section operations.

Methods

Section createSection(SectionCreateStruct $sectionCreateStruct)

Creates the a new Section in the content repository.

Section updateSection(Section $section, SectionUpdateStruct $sectionUpdateStruct)

Updates the given in the content repository.

Section loadSection(mixed $sectionId)

Loads a Section from its id ($sectionId).

array loadSections()

Loads all sections.

Section loadSectionByIdentifier(string $sectionIdentifier)

Loads a Section from its identifier ($sectionIdentifier).

int countAssignedContents(Section $section)

Counts the contents which $section is assigned to.

bool isSectionUsed(Section $section)

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

assignSection(ContentInfo $contentInfo, Section $section)

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

deleteSection(Section $section)

Deletes $section from content repository.

SectionCreateStruct newSectionCreateStruct()

Instantiates a new SectionCreateStruct.

SectionUpdateStruct newSectionUpdateStruct()

Instantiates a new SectionUpdateStruct.

Details

at line 31
public Section createSection(SectionCreateStruct $sectionCreateStruct)

Creates the a new Section in the content repository.

Parameters

SectionCreateStruct $sectionCreateStruct

Return Value

Section The newly create section

Exceptions

UnauthorizedException If the current user user is not allowed to create a section
InvalidArgumentException If the new identifier in $sectionCreateStruct already exists

at line 44
public Section updateSection(Section $section, SectionUpdateStruct $sectionUpdateStruct)

Updates the given in the content repository.

Parameters

Section $section
SectionUpdateStruct $sectionUpdateStruct

Return Value

Section

Exceptions

UnauthorizedException If the current user user is not allowed to create a section
InvalidArgumentException If the new identifier already exists (if set in the update struct)

at line 56
public Section loadSection(mixed $sectionId)

Loads a Section from its id ($sectionId).

Parameters

mixed $sectionId

Return Value

Section

Exceptions

NotFoundException if section could not be found
UnauthorizedException If the current user user is not allowed to read a section

at line 65
public array loadSections()

Loads all sections.

Return Value

array of {@link \eZ\Publish\API\Repository\Values\Content\Section}

Exceptions

UnauthorizedException If the current user user is not allowed to read a section

at line 77
public Section loadSectionByIdentifier(string $sectionIdentifier)

Loads a Section from its identifier ($sectionIdentifier).

Parameters

string $sectionIdentifier

Return Value

Section

Exceptions

NotFoundException if section could not be found
UnauthorizedException If the current user user is not allowed to read a section

at line 88
public int countAssignedContents(Section $section)

Counts the contents which $section is assigned to.

Parameters

Section $section

Return Value

int

at line 101
public bool 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.

Parameters

Section $section

Return Value

bool

at line 112
public assignSection(ContentInfo $contentInfo, Section $section)

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

Parameters

ContentInfo $contentInfo
Section $section

Exceptions

UnauthorizedException If user does not have access to view provided object

at line 124
public deleteSection(Section $section)

Deletes $section from content repository.

Parameters

Section $section

Exceptions

NotFoundException If the specified section is not found
UnauthorizedException If the current user user is not allowed to delete a section
BadStateException if section can not be deleted because it is still assigned to some contents.

at line 131
public SectionCreateStruct newSectionCreateStruct()

Instantiates a new SectionCreateStruct.

Return Value

SectionCreateStruct

at line 138
public SectionUpdateStruct newSectionUpdateStruct()

Instantiates a new SectionUpdateStruct.

Return Value

SectionUpdateStruct