Completed
Pull Request — master (#6)
by Nick
02:39
created

ViewMode   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 81
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

7 Methods

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