eZPublishCommunityProject  2012.12
eZ\Publish\Core\REST\Client\SectionService Class Reference

Implementation of the eZ\Publish\API\Repository\SectionServiceinterface. More...

+ Inheritance diagram for eZ\Publish\Core\REST\Client\SectionService:
+ Collaboration diagram for eZ\Publish\Core\REST\Client\SectionService:

Public Member Functions

 __construct (HttpClient $client, Dispatcher $inputDispatcher, Visitor $outputVisitor, UrlHandler $urlHandler)
 
 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 the 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...
 
 setSession ($id)
 Set session ID. More...
 
 updateSection (Section $section, SectionUpdateStruct $sectionUpdateStruct)
 Updates the given in the content repository. More...
 

Private Attributes

 $client
 
 $inputDispatcher
 
 $outputVisitor
 
 $urlHandler
 

Detailed Description

Implementation of the eZ\Publish\API\Repository\SectionServiceinterface.

See Also

Constructor & Destructor Documentation

eZ\Publish\Core\REST\Client\SectionService::__construct ( HttpClient  $client,
Dispatcher  $inputDispatcher,
Visitor  $outputVisitor,
UrlHandler  $urlHandler 
)
Parameters
\eZ\Publish\Core\REST\Client\HttpClient$client
\eZ\Publish\Core\REST\Common\Input\Dispatcher$inputDispatcher
\eZ\Publish\Core\REST\Common\Output\Visitor$outputVisitor
\eZ\Publish\Core\REST\Common\UrlHandler$urlHandler

Member Function Documentation

eZ\Publish\Core\REST\Client\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
Todo:
In order to make the integration test for this method running, the countAssignedContents() method must be implemented. Otherwise this should work fine.

Implements eZ\Publish\API\Repository\SectionService.

eZ\Publish\Core\REST\Client\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.

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

Creates the 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 create section

Implements eZ\Publish\API\Repository\SectionService.

eZ\Publish\Core\REST\Client\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 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\REST\Client\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
mixed$sectionId
Returns

Implements eZ\Publish\API\Repository\SectionService.

eZ\Publish\Core\REST\Client\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.

eZ\Publish\Core\REST\Client\SectionService::loadSections ( )

Loads all sections.

Exceptions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionIf the current user user is not allowed to read a section
Returns
array of eZ\Publish\API\Repository\Values\Content\Section

Implements eZ\Publish\API\Repository\SectionService.

eZ\Publish\Core\REST\Client\SectionService::newSectionCreateStruct ( )

Instantiates a new SectionCreateStruct.

Returns

Implements eZ\Publish\API\Repository\SectionService.

eZ\Publish\Core\REST\Client\SectionService::newSectionUpdateStruct ( )

Instantiates a new SectionUpdateStruct.

Returns

Implements eZ\Publish\API\Repository\SectionService.

eZ\Publish\Core\REST\Client\SectionService::setSession (   $id)

Set session ID.

Only for testing

Parameters
mixed$id
Returns
void

Implements eZ\Publish\Core\REST\Client\Sessionable.

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

Updates the given 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\REST\Client\SectionService::$client
private
eZ\Publish\Core\REST\Client\SectionService::$inputDispatcher
private
eZ\Publish\Core\REST\Client\SectionService::$outputVisitor
private
eZ\Publish\Core\REST\Client\SectionService::$urlHandler
private

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