Completed
Pull Request — master (#257)
by Éloi
01:56
created

MediaRestrictionRelationship

Complexity

Total Complexity 0

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 0
lcom 0
cbo 1
dl 0
loc 10
ccs 0
cts 0
cp 0
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
/*
3
 * This file is part of the feed-io package.
4
 *
5
 * (c) Alexandre Debril <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace FeedIo\Feed\Item;
12
13
abstract class MediaRestrictionRelationship extends MediaConstant
14
{
15
    const Allow = 1;
16
    const Deny = 2;
17
18
    const VALUES = array(
19
        "allow" => MediaRestrictionRelationship::Allow,
20
        "deny" => MediaRestrictionRelationship::Deny,
21
    );
22
}
23
24
abstract class MediaRestrictionType extends MediaConstant
25
{
26
    const Country = 1;
27
    const URI = 2;
28
    const Sharing = 3;
29
30
    const VALUES = array(
31
        null => MediaRestrictionType::Sharing,
32
        "country" => MediaRestrictionType::Country,
33
        "uri" => MediaRestrictionType::URI,
34
        "sharing" => MediaRestrictionType::Sharing,
35
    );
36
}
37
38
39
class MediaRestriction implements MediaRestrictionInterface
40
{
41
42
    /**
43
     * @var string
44
     */
45
    protected $content;
46
47
    /**
48
     * @var int
49
     */
50
    protected $type;
51
52
    /**
53
     * @var int
54
     */
55
    protected $relationship;
56
57
58
    /**
59
     * @return string
60
     */
61 2
    public function getContent() : ?string
62
    {
63 2
        return $this->content;
64
    }
65
66
    /**
67
     * @param  string $content
68
     * @return MediaRestrictionInterface
69
     */
70 2
    public function setContent(?string $content) : MediaRestrictionInterface
71
    {
72 2
        $this->content = $content;
73
74 2
        return $this;
75
    }
76
77
78
    /**
79
     * @return int
80
     */
81 2
    public function getType() : ?int
82
    {
83 2
        return $this->type;
84
    }
85
86
    /**
87
     * @param  int $type
88
     * @return MediaRestrictionInterface
89
     */
90 2
    public function setType(?int $type) : MediaRestrictionInterface
91
    {
92 2
        $this->type = $type;
93
94 2
        return $this;
95
    }
96
97
    /**
98
     * @return int
99
     */
100 2
    public function getRelationship() : ?int
101
    {
102 2
        return $this->relationship;
103
    }
104
105
    /**
106
     * @param  int $relationship
107
     * @return MediaRestrictionInterface
108
     */
109 2
    public function setRelationship(?int $relationship) : MediaRestrictionInterface
110
    {
111 2
        $this->relationship = $relationship;
112
113 2
        return $this;
114
    }
115
}
116