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

SectionLimitation::buildLimitationObject()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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