Completed
Pull Request — master (#72)
by Thibaud
08:29
created

Technical::getValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 4
ccs 0
cts 0
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
/*
4
 * This file is part of Phraseanet SDK.
5
 *
6
 * (c) Alchemy <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace PhraseanetSDK\Entity;
13
14
class Technical
15
{
16
17 6
    public static function fromList(array $values)
18
    {
19 6
        $technical = array();
20
21 6
        foreach ($values as $value) {
22 6
            $technical[] = self::fromValue($value);
23 6
        }
24
25 6
        return $technical;
26
    }
27
28 6
    public static function fromValue(\stdClass $value)
29
    {
30 6
        return new self($value);
31
    }
32
33
    /**
34
     * @var \stdClass
35
     */
36
    protected $source;
37
38
    /**
39
     * @param \stdClass $source
40
     */
41 6
    public function __construct(\stdClass $source)
42
    {
43 6
        $this->source = $source;
44 6
    }
45
46
    /**
47
     * @return \stdClass
48
     */
49
    public function getRawData()
50
    {
51
        return $this->source;
52
    }
53
54
    /**
55
     * @return \stdClass
56
     * @deprecated Use getRawData() instead
57
     */
58
    public function getSource()
59 6
    {
60
        return $this->source;
61 6
    }
62
63
    /**
64
     * Get the technical information name
65
     *
66
     * @return string
67
     */
68
    public function getName()
69 6
    {
70
        return $this->source->name;
71 6
    }
72
73
    /**
74
     * Get the technical value
75
     *
76
     * @return string
77
     */
78
    public function getValue()
79
    {
80
        return $this->source->value;
81
    }
82
}
83