Completed
Push — ezp26352-skip_csrf_check_on_re... ( 19f37a )
by
unknown
36:29
created

ResourceLink   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
1
<?php
2
/**
3
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
4
 * @license For full copyright and license information view LICENSE file distributed with this source code.
5
 */
6
namespace eZ\Publish\Core\REST\Server\Values;
7
8
use eZ\Publish\API\Repository\Values\ValueObject;
9
10
/**
11
 * A link to a REST resource.
12
 *
13
 * @property string $link
14
 * @property string $mediaType
15
 */
16
class ResourceLink extends ValueObject
17
{
18
    /**
19
     * REST resource href.
20
     * Example: '/api/ezp/v2/content/objects/1'.
21
     *
22
     * @var string
23
     */
24
    protected $link;
25
26
    /**
27
     * Resource media-type. If not specified, the default one is used.
28
     * @var string|null
29
     */
30
    protected $mediaType;
31
32
    public function __construct($link, $mediaType = null)
33
    {
34
        $this->link = $link;
35
        $this->mediaType = $mediaType;
36
    }
37
}
38