Completed
Push — master ( 621ea2...dd23a3 )
by Nick
12s
created

ViewMode   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 79
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 8
lcom 1
cbo 2
dl 0
loc 79
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A setId() 0 9 2
A getId() 0 4 1
A getLabel() 0 4 1
A getUrl() 0 4 1
A getHtml() 0 4 1
A getPreviewImage() 0 4 1
1
<?php
2
3
namespace Acquia\LiftClient\Entity;
4
5
use Acquia\LiftClient\Exception\LiftSdkException;
6
7
class ViewMode extends Entity
8
{
9
    /**
10
     * @param array $array
11
     */
12
    public function __construct(array $array = [])
13
    {
14
        parent::__construct($array);
15
    }
16
17
    /**
18
     * Sets the 'id' parameter.
19
     *
20
     * @param string $id
21
     *
22
     * @throws \Acquia\LiftClient\Exception\LiftSdkException
23
     *
24
     * @return \Acquia\LiftClient\Entity\ViewMode
25
     */
26
    public function setId($id)
27
    {
28
        if (!is_string($id)) {
29
            throw new LiftSdkException('Argument must be an instance of string.');
30
        }
31
        $this['id'] = $id;
32
33
        return $this;
34
    }
35
36
    /**
37
     * Gets the 'id' parameter.
38
     *
39
     * @return string
40
     */
41
    public function getId()
42
    {
43
        return $this->getEntityValue('id', '');
44
    }
45
46
    /**
47
     * Gets the 'id' parameter.
48
     *
49
     * @return string
50
     */
51
    public function getLabel()
52
    {
53
        return $this->getEntityValue('label', '');
54
    }
55
56
    /**
57
     * Gets the 'url' parameter.
58
     *
59
     * @return string
60
     */
61
    public function getUrl()
62
    {
63
        return $this->getEntityValue('url', '');
64
    }
65
66
    /**
67
     * Gets the 'html' parameter.
68
     *
69
     * @return string
70
     */
71
    public function getHtml()
72
    {
73
        return $this->getEntityValue('html', '');
74
    }
75
76
    /**
77
     * Gets the 'preview_image' parameter.
78
     *
79
     * @return string
80
     */
81
    public function getPreviewImage()
82
    {
83
        return $this->getEntityValue('preview_image', '');
84
    }
85
}
86