Completed
Push — master ( 40e49a...c75a1a )
by François
02:05
created

UserAgent::getAgent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Bouncer package.
5
 *
6
 * (c) François Hodierne <[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 Bouncer\Resource;
13
14
use Bouncer\Resource;
15
16
class UserAgent extends Resource
17
{
18
19
    /**
20
     * The unique id
21
     *
22
     * @var string
23
     */
24
    protected $id;
25
26
    /**
27
     * Type: browser or robot
28
     *
29
     * @var string
30
     */
31
    protected $type;
32
33
    /**
34
     * Agent
35
     *
36
     * @var object
37
     */
38
    protected $agent;
39
40
    /**
41
     * System
42
     *
43
     * @var object
44
     */
45
    protected $system;
46
47
    public function getId()
48
    {
49
        return $this->id;
50
    }
51
52
    public function setId($id)
53
    {
54
        $this->id = $id;
55
    }
56
57
    public function getType()
58
    {
59
        return $this->type;
60
    }
61
62
    public function setType($type)
63
    {
64
        $this->type = $type;
65
    }
66
67
    public function getAgent()
68
    {
69
        return $this->agent;
70
    }
71
72
    public function setAgent($agent)
73
    {
74
        if (is_object($agent)) {
75
            $this->agent = $agent;
76
        } elseif (is_array($agent)) {
77
            $this->agent = new UserAgentPart($agent);
78
        }
79
    }
80
81
    public function getSystem()
82
    {
83
        return $this->system;
84
    }
85
86
    public function setSystem($system)
87
    {
88
        if (is_object($system)) {
89
            $this->system = $system;
90
        } elseif (is_array($system)) {
91
            $this->system = new UserAgentPart($system);
92
        }
93
    }
94
95
}
96