Completed
Push — rest_role_limitation_href ( 55b811 )
by
unknown
28:34
created

SectionLimitation   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 2
c 1
b 1
f 0
lcom 0
cbo 2
dl 0
loc 22
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getLimitationValueHrefIdName() 0 4 1
A buildLimitationObject() 0 4 1
1
<?php
2
/**
3
 * @license For full copyright and license information view LICENSE file distributed with this source code.
4
 */
5
namespace eZ\Publish\Core\REST\Server\Input\Parser\Limitation;
6
7
use eZ\Publish\API\Repository\Values\User\Limitation;
8
9
class SectionLimitation extends BaseLimitationParser
10
{
11
12
    /**
13
     * Returns the name of the id variable in the href of a limitation value.
14
     * Example: the ID of the Section in /content/sections/{contentId} is 'contentId'.
15
     * @return string
16
     */
17
    protected function getLimitationValueHrefIdName()
18
    {
19
        return 'sectionId';
20
    }
21
22
    /**
23
     * Returns the limitation object the parser handles.
24
     * @return \eZ\Publish\API\Repository\Values\User\Limitation A Limitation value object
25
     */
26
    protected function buildLimitationObject()
27
    {
28
        return new Limitation\SectionLimitation();
29
    }
30
}
31