eZPublishCommunityProject  2012.12
eZ\Publish\Core\Repository\SectionService Class Reference
+ Inheritance diagram for eZ\Publish\Core\Repository\SectionService:
+ Collaboration diagram for eZ\Publish\Core\Repository\SectionService:

Public Member Functions

 __construct (RepositoryInterface $repository, Handler $sectionHandler, array $settings=array())
 Setups service with reference to repository object that created it & corresponding handler. More...
 
 assignSection (ContentInfo $contentInfo, Section $section)
 Assigns the content to the given section this method overrides the current assigned section. More...
 
 countAssignedContents (Section $section)
 Counts the contents which $section is assigned to. More...
 
 createSection (SectionCreateStruct $sectionCreateStruct)
 Creates a new Section in the content repository. More...
 
 deleteSection (Section $section)
 Deletes $section from content repository. More...
 
 loadSection ($sectionId)
 Loads a Section from its id ($sectionId) More...
 
 loadSectionByIdentifier ($sectionIdentifier)
 Loads a Section from its identifier ($sectionIdentifier) More...
 
 loadSections ()
 Loads all sections. More...
 
 newSectionCreateStruct ()
 Instantiates a new SectionCreateStruct. More...
 
 newSectionUpdateStruct ()
 Instantiates a new SectionUpdateStruct. More...
 
 updateSection (Section $section, SectionUpdateStruct $sectionUpdateStruct)
 Updates the given section in the content repository. More...
 

Protected Member Functions

 buildDomainSectionObject (SPISection $spiSection)
 Builds API Section object from provided SPI Section object. More...
 

Protected Attributes

 $repository
 
 $sectionHandler
 
 $settings
 

Constructor & Destructor Documentation

eZ\Publish\Core\Repository\SectionService::__construct ( RepositoryInterface  $repository,
Handler  $sectionHandler,
array  $settings = array() 
)

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
array$settings

Member Function Documentation

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
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionIf user does not have access to view provided object
Parameters
\eZ\Publish\API\Repository\Values\Content\ContentInfo$contentInfo
\eZ\Publish\API\Repository\Values\Content\Section$section

Implements eZ\Publish\API\Repository\SectionService.

eZ\Publish\Core\Repository\SectionService::buildDomainSectionObject ( SPISection  $spiSection)
protected
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

Implements eZ\Publish\API\Repository\SectionService.

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

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

Creates a new Section in the content repository.

Exceptions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionIf the current user user is not allowed to create a section
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionIf the new identifier in $sectionCreateStruct already exists
Parameters
\eZ\Publish\API\Repository\Values\Content\SectionCreateStruct$sectionCreateStruct
Returns
The newly created section

Implements eZ\Publish\API\Repository\SectionService.

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

Deletes $section from content repository.

Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionIf the specified section is not found
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionIf the current user is not allowed to delete a section
\eZ\Publish\API\Repository\Exceptions\BadStateExceptionIf section can not be deleted because it is still assigned to some contents.
Parameters
\eZ\Publish\API\Repository\Values\Content\Section$section

Implements eZ\Publish\API\Repository\SectionService.

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

Loads a Section from its id ($sectionId)

Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionif section could not be found
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionIf the current user user is not allowed to read a section
Parameters
int$sectionId
Returns

Implements eZ\Publish\API\Repository\SectionService.

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

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

Loads a Section from its identifier ($sectionIdentifier)

Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionif section could not be found
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionIf the current user user is not allowed to read a section
Parameters
string$sectionIdentifier
Returns

Implements eZ\Publish\API\Repository\SectionService.

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

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

Loads all sections.

Exceptions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionIf the current user user is not allowed to read a section
Returns
[]

Implements eZ\Publish\API\Repository\SectionService.

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

Instantiates a new SectionCreateStruct.

Returns

Implements eZ\Publish\API\Repository\SectionService.

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

Instantiates a new SectionUpdateStruct.

Returns

Implements eZ\Publish\API\Repository\SectionService.

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

Updates the given section in the content repository.

Exceptions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionIf the current user user is not allowed to create a section
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionIf the new identifier already exists (if set in the update struct)
Parameters
\eZ\Publish\API\Repository\Values\Content\Section$section
\eZ\Publish\API\Repository\Values\Content\SectionUpdateStruct$sectionUpdateStruct
Returns

Implements eZ\Publish\API\Repository\SectionService.

Member Data Documentation

eZ\Publish\Core\Repository\SectionService::$repository
protected
eZ\Publish\Core\Repository\SectionService::$sectionHandler
protected
eZ\Publish\Core\Repository\SectionService::$settings
protected

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