Passed
Push — devel-3.0 ( ae4d76...a795fa )
by Rubén
02:56
created

AccountActionsDto::getPublicLinkCreatorId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * sysPass
4
 *
5
 * @author    nuxsmin
6
 * @link      https://syspass.org
7
 * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org
8
 *
9
 * This file is part of sysPass.
10
 *
11
 * sysPass is free software: you can redistribute it and/or modify
12
 * it under the terms of the GNU General Public License as published by
13
 * the Free Software Foundation, either version 3 of the License, or
14
 * (at your option) any later version.
15
 *
16
 * sysPass is distributed in the hope that it will be useful,
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
 * GNU General Public License for more details.
20
 *
21
 * You should have received a copy of the GNU General Public License
22
 *  along with sysPass.  If not, see <http://www.gnu.org/licenses/>.
23
 */
24
25
namespace SP\Modules\Web\Controllers\Helpers\Account;
26
27
/**
28
 * Class AccountActionsDto
29
 *
30
 * @package SP\Modules\Web\Controllers\Helpers\Account
31
 */
32
final class AccountActionsDto
33
{
34
    /**
35
     * @var int
36
     */
37
    private $accountId;
38
    /**
39
     * @var int
40
     */
41
    private $accountHistoryId;
42
    /**
43
     * @var int
44
     */
45
    private $accountParentId;
46
    /**
47
     * @var int
48
     */
49
    private $publicLinkId;
50
    /**
51
     * @var int
52
     */
53
    private $publicLinkCreatorId;
54
55
    /**
56
     * AccountActionsDto constructor.
57
     *
58
     * @param int $accountId
59
     * @param int $accountHistoryId
60
     * @param int $accountParentId
61
     */
62
    public function __construct($accountId, $accountHistoryId = null, $accountParentId = null)
63
    {
64
        $this->accountId = $accountId;
65
        $this->accountHistoryId = $accountHistoryId;
66
        $this->accountParentId = $accountParentId;
67
    }
68
69
    /**
70
     * @return int
71
     */
72
    public function getAccountId()
73
    {
74
        return $this->accountId;
75
    }
76
77
    /**
78
     * @return int
79
     */
80
    public function getAccountHistoryId()
81
    {
82
        return $this->accountHistoryId;
83
    }
84
85
    /**
86
     * @return int
87
     */
88
    public function getAccountParentId()
89
    {
90
        return $this->accountParentId;
91
    }
92
93
    /**
94
     * @return bool
95
     */
96
    public function isHistory()
97
    {
98
        return $this->accountHistoryId !== null && $this->accountHistoryId > 0;
99
    }
100
101
    /**
102
     * @return bool
103
     */
104
    public function isLinked()
105
    {
106
        return $this->accountParentId !== null && $this->accountParentId > 0;
107
    }
108
109
    /**
110
     * @return int
111
     */
112
    public function getPublicLinkId()
113
    {
114
        return $this->publicLinkId;
115
    }
116
117
    /**
118
     * @param int $publicLinkId
119
     */
120
    public function setPublicLinkId(int $publicLinkId)
121
    {
122
        $this->publicLinkId = $publicLinkId;
123
    }
124
125
    /**
126
     * @return int
127
     */
128
    public function getPublicLinkCreatorId()
129
    {
130
        return $this->publicLinkCreatorId;
131
    }
132
133
    /**
134
     * @param int $publicLinkCreatorId
135
     */
136
    public function setPublicLinkCreatorId(int $publicLinkCreatorId)
137
    {
138
        $this->publicLinkCreatorId = $publicLinkCreatorId;
139
    }
140
}