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

ResourceLink::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 2
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
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