forked from ezsystems/PlatformUIBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SectionHelperInterface.php
94 lines (84 loc) · 3.06 KB
/
SectionHelperInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?php
/**
* File containing the SectionHelperInterface interface.
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
namespace EzSystems\PlatformUIBundle\Helper;
use eZ\Publish\API\Repository\Values\Content\Section;
use EzSystems\PlatformUIBundle\Entity\Section as SectionEntity;
use EzSystems\PlatformUIBundle\Entity\SectionList;
/**
* Interface SectionHelperInterface
*
* Provides utility methods to handle section stored in the API
*
* @package EzSystems\PlatformUIBundle\Helper
*/
interface SectionHelperInterface
{
/**
* Returns the section list
*
* @return array[] key is section id and value a \EzSystems\PlatformUIBundle\Entity\SectionListItem
*/
public function getSectionList();
/**
* Returns whether the current user can create a new section
*
* @return boolean
*/
public function canCreate();
/**
* Returns a section
*
* @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException if section could not be found
* @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException If the current user user is not allowed to read a section
*
* @param mixed $sectionId
*
* @return \eZ\Publish\API\Repository\Values\Content\Section
*/
public function loadSection( $sectionId );
/**
* Returns the number of contents assigned to a given $section
* @param \eZ\Publish\API\Repository\Values\Content\Section $section
* @return int
*/
public function contentCount( Section $section );
/**
* Creates a new Section in the content repository
*
* @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException If the current user is
* not allowed to create a section
* @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException If the new identifier
* already exists
*
* @param \EzSystems\PlatformUIBundle\Entity\Section $section
*
* @return \eZ\Publish\API\Repository\Values\Content\Section The newly created section
*/
public function createSection( SectionEntity $section );
/**
* Updates a Section in the content repository
*
* @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException If the current user is
* not allowed to update a section
* @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException If the new identifier
* already exists
*
* @param \eZ\Publish\API\Repository\Values\Content\Section $sectionToUpdate
* @param \EzSystems\PlatformUIBundle\Entity\Section $section
*
* @return \eZ\Publish\API\Repository\Values\Content\Section The updated section
*/
public function updateSection( Section $sectionToUpdate, SectionEntity $section );
/**
* Removes sections
*
* @param \EzSystems\PlatformUIBundle\Entity\SectionList $sectionList sections to be deleted
*
*/
public function deleteSectionList( SectionList $sectionList );
}