Completed
Push — master ( 4e0ac6...0fdc9b )
by Łukasz
25:36
created

SectionService   A

Complexity

Total Complexity 12

Size/Duplication

Total Lines 71
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 71
rs 10
c 0
b 0
f 0
wmc 12
lcom 1
cbo 1

12 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A createSection() 0 4 1
A updateSection() 0 4 1
A loadSection() 0 4 1
A loadSections() 0 4 1
A loadSectionByIdentifier() 0 4 1
A countAssignedContents() 0 4 1
A isSectionUsed() 0 4 1
A assignSection() 0 4 1
A deleteSection() 0 4 1
A newSectionCreateStruct() 0 4 1
A newSectionUpdateStruct() 0 4 1
1
<?php
2
3
/**
4
 * SectionService class.
5
 *
6
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
7
 * @license For full copyright and license information view LICENSE file distributed with this source code.
8
 */
9
namespace eZ\Publish\Core\Repository\SiteAccessAware;
10
11
use eZ\Publish\API\Repository\SectionService as SectionServiceInterface;
12
use eZ\Publish\API\Repository\Values\Content\SectionCreateStruct;
13
use eZ\Publish\API\Repository\Values\Content\SectionUpdateStruct;
14
use eZ\Publish\API\Repository\Values\Content\Section;
15
use eZ\Publish\API\Repository\Values\Content\ContentInfo;
16
17
/**
18
 * SectionService for SiteAccessAware layer.
19
 *
20
 * Currently does nothing but hand over calls to aggregated service.
21
 */
22
class SectionService implements SectionServiceInterface
23
{
24
    /** @var \eZ\Publish\API\Repository\SectionService */
25
    protected $service;
26
27
    /**
28
     * Construct service object from aggregated service.
29
     *
30
     * @param \eZ\Publish\API\Repository\SectionService $service
31
     */
32
    public function __construct(
33
        SectionServiceInterface $service
34
    ) {
35
        $this->service = $service;
36
    }
37
38
    public function createSection(SectionCreateStruct $sectionCreateStruct)
39
    {
40
        return $this->service->createSection($sectionCreateStruct);
41
    }
42
43
    public function updateSection(Section $section, SectionUpdateStruct $sectionUpdateStruct)
44
    {
45
        return $this->service->updateSection($section, $sectionUpdateStruct);
46
    }
47
48
    public function loadSection($sectionId)
49
    {
50
        return $this->service->loadSection($sectionId);
51
    }
52
53
    public function loadSections()
54
    {
55
        return $this->service->loadSections();
56
    }
57
58
    public function loadSectionByIdentifier($sectionIdentifier)
59
    {
60
        return $this->service->loadSectionByIdentifier($sectionIdentifier);
61
    }
62
63
    public function countAssignedContents(Section $section)
64
    {
65
        return $this->service->countAssignedContents($section);
0 ignored issues
show
Deprecated Code introduced by
The method eZ\Publish\API\Repositor...countAssignedContents() has been deprecated with message: since 6.0

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
66
    }
67
68
    public function isSectionUsed(Section $section)
69
    {
70
        return $this->service->isSectionUsed($section);
71
    }
72
73
    public function assignSection(ContentInfo $contentInfo, Section $section)
74
    {
75
        return $this->service->assignSection($contentInfo, $section);
76
    }
77
78
    public function deleteSection(Section $section)
79
    {
80
        return $this->service->deleteSection($section);
81
    }
82
83
    public function newSectionCreateStruct()
84
    {
85
        return $this->service->newSectionCreateStruct();
86
    }
87
88
    public function newSectionUpdateStruct()
89
    {
90
        return $this->service->newSectionUpdateStruct();
91
    }
92
}
93