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

ViewMode::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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