This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | /* |
||
4 | * This file is part of Jitamin. |
||
5 | * |
||
6 | * Copyright (C) Jitamin Team |
||
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 Jitamin\Model; |
||
13 | |||
14 | use Jitamin\Foundation\Database\Model; |
||
15 | use Jitamin\Foundation\Security\Role; |
||
16 | |||
17 | /** |
||
18 | * Class ProjectRoleModel. |
||
19 | */ |
||
20 | class ProjectRoleModel extends Model |
||
21 | { |
||
22 | /** |
||
23 | * SQL table name. |
||
24 | * |
||
25 | * @var string |
||
26 | */ |
||
27 | const TABLE = 'project_has_roles'; |
||
28 | |||
29 | /** |
||
30 | * Get list of project roles. |
||
31 | * |
||
32 | * @param int $project_id |
||
33 | * |
||
34 | * @return array |
||
35 | */ |
||
36 | public function getList($project_id) |
||
37 | { |
||
38 | $defaultRoles = $this->role->getProjectRoles(); |
||
0 ignored issues
–
show
|
|||
39 | $customRoles = $this->db |
||
0 ignored issues
–
show
The property
db does not exist on object<Jitamin\Model\ProjectRoleModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
40 | ->hashtable(self::TABLE) |
||
41 | ->eq('project_id', $project_id) |
||
42 | ->getAll('role', 'role'); |
||
43 | |||
44 | return $defaultRoles + $customRoles; |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * Get a role. |
||
49 | * |
||
50 | * @param int $project_id |
||
51 | * @param int $role_id |
||
52 | * |
||
53 | * @return array|null |
||
54 | */ |
||
55 | public function getById($project_id, $role_id) |
||
56 | { |
||
57 | return $this->db->table(self::TABLE) |
||
0 ignored issues
–
show
The property
db does not exist on object<Jitamin\Model\ProjectRoleModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
58 | ->eq('project_id', $project_id) |
||
59 | ->eq('role_id', $role_id) |
||
60 | ->findOne(); |
||
61 | } |
||
62 | |||
63 | /** |
||
64 | * Get all project roles. |
||
65 | * |
||
66 | * @param int $project_id |
||
67 | * |
||
68 | * @return array |
||
69 | */ |
||
70 | public function getAll($project_id) |
||
71 | { |
||
72 | return $this->db->table(self::TABLE) |
||
0 ignored issues
–
show
The property
db does not exist on object<Jitamin\Model\ProjectRoleModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
73 | ->eq('project_id', $project_id) |
||
74 | ->asc('role') |
||
75 | ->findAll(); |
||
76 | } |
||
77 | |||
78 | /** |
||
79 | * Get all project roles with restrictions. |
||
80 | * |
||
81 | * @param int $project_id |
||
82 | * |
||
83 | * @return array |
||
84 | */ |
||
85 | public function getAllWithRestrictions($project_id) |
||
86 | { |
||
87 | $roles = $this->getAll($project_id); |
||
88 | |||
89 | $column_restrictions = $this->columnRestrictionModel->getAll($project_id); |
||
0 ignored issues
–
show
The property
columnRestrictionModel does not exist on object<Jitamin\Model\ProjectRoleModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
90 | $column_restrictions = array_column_index($column_restrictions, 'role_id'); |
||
91 | array_merge_relation($roles, $column_restrictions, 'column_restrictions', 'role_id'); |
||
92 | |||
93 | $column_move_restrictions = $this->columnMoveRestrictionModel->getAll($project_id); |
||
0 ignored issues
–
show
The property
columnMoveRestrictionModel does not exist on object<Jitamin\Model\ProjectRoleModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
94 | $column_move_restrictions = array_column_index($column_move_restrictions, 'role_id'); |
||
95 | array_merge_relation($roles, $column_move_restrictions, 'column_move_restrictions', 'role_id'); |
||
96 | |||
97 | $project_restrictions = $this->projectRoleRestrictionModel->getAll($project_id); |
||
0 ignored issues
–
show
The property
projectRoleRestrictionModel does not exist on object<Jitamin\Model\ProjectRoleModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
98 | $project_restrictions = array_column_index($project_restrictions, 'role_id'); |
||
99 | array_merge_relation($roles, $project_restrictions, 'project_restrictions', 'role_id'); |
||
100 | |||
101 | return $roles; |
||
102 | } |
||
103 | |||
104 | /** |
||
105 | * Create a new project role. |
||
106 | * |
||
107 | * @param int $project_id |
||
108 | * @param string $role |
||
109 | * |
||
110 | * @return bool|int |
||
111 | */ |
||
112 | public function create($project_id, $role) |
||
113 | { |
||
114 | return $this->db |
||
0 ignored issues
–
show
The property
db does not exist on object<Jitamin\Model\ProjectRoleModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
115 | ->table(self::TABLE) |
||
116 | ->persist([ |
||
117 | 'project_id' => $project_id, |
||
118 | 'role' => $role, |
||
119 | ]); |
||
120 | } |
||
121 | |||
122 | /** |
||
123 | * Update a project role. |
||
124 | * |
||
125 | * @param int $role_id |
||
126 | * @param int $project_id |
||
127 | * @param string $role |
||
128 | * |
||
129 | * @return bool |
||
130 | */ |
||
131 | public function update($role_id, $project_id, $role) |
||
132 | { |
||
133 | $this->db->startTransaction(); |
||
0 ignored issues
–
show
The property
db does not exist on object<Jitamin\Model\ProjectRoleModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
134 | |||
135 | $previousRole = $this->getById($project_id, $role_id); |
||
136 | |||
137 | $r1 = $this->db |
||
0 ignored issues
–
show
The property
db does not exist on object<Jitamin\Model\ProjectRoleModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
138 | ->table(ProjectUserRoleModel::TABLE) |
||
139 | ->eq('project_id', $project_id) |
||
140 | ->eq('role', $previousRole['role']) |
||
141 | ->update([ |
||
142 | 'role' => $role, |
||
143 | ]); |
||
144 | |||
145 | $r2 = $this->db |
||
0 ignored issues
–
show
The property
db does not exist on object<Jitamin\Model\ProjectRoleModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
146 | ->table(ProjectGroupRoleModel::TABLE) |
||
147 | ->eq('project_id', $project_id) |
||
148 | ->eq('role', $previousRole['role']) |
||
149 | ->update([ |
||
150 | 'role' => $role, |
||
151 | ]); |
||
152 | |||
153 | $r3 = $this->db |
||
0 ignored issues
–
show
The property
db does not exist on object<Jitamin\Model\ProjectRoleModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
154 | ->table(self::TABLE) |
||
155 | ->eq('role_id', $role_id) |
||
156 | ->eq('project_id', $project_id) |
||
157 | ->update([ |
||
158 | 'role' => $role, |
||
159 | ]); |
||
160 | |||
161 | if ($r1 && $r2 && $r3) { |
||
162 | $this->db->closeTransaction(); |
||
0 ignored issues
–
show
The property
db does not exist on object<Jitamin\Model\ProjectRoleModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
163 | |||
164 | return true; |
||
165 | } |
||
166 | |||
167 | $this->db->cancelTransaction(); |
||
0 ignored issues
–
show
The property
db does not exist on object<Jitamin\Model\ProjectRoleModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
168 | |||
169 | return false; |
||
170 | } |
||
171 | |||
172 | /** |
||
173 | * Remove a project role. |
||
174 | * |
||
175 | * @param int $project_id |
||
176 | * @param int $role_id |
||
177 | * |
||
178 | * @return bool |
||
179 | */ |
||
180 | public function remove($project_id, $role_id) |
||
181 | { |
||
182 | $this->db->startTransaction(); |
||
0 ignored issues
–
show
The property
db does not exist on object<Jitamin\Model\ProjectRoleModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
183 | |||
184 | $role = $this->getById($project_id, $role_id); |
||
185 | |||
186 | $r1 = $this->db |
||
0 ignored issues
–
show
The property
db does not exist on object<Jitamin\Model\ProjectRoleModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
187 | ->table(ProjectUserRoleModel::TABLE) |
||
188 | ->eq('project_id', $project_id) |
||
189 | ->eq('role', $role['role']) |
||
190 | ->update([ |
||
191 | 'role' => Role::PROJECT_MEMBER, |
||
192 | ]); |
||
193 | |||
194 | $r2 = $this->db |
||
0 ignored issues
–
show
The property
db does not exist on object<Jitamin\Model\ProjectRoleModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
195 | ->table(ProjectGroupRoleModel::TABLE) |
||
196 | ->eq('project_id', $project_id) |
||
197 | ->eq('role', $role['role']) |
||
198 | ->update([ |
||
199 | 'role' => Role::PROJECT_MEMBER, |
||
200 | ]); |
||
201 | |||
202 | $r3 = $this->db |
||
0 ignored issues
–
show
The property
db does not exist on object<Jitamin\Model\ProjectRoleModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
203 | ->table(self::TABLE) |
||
204 | ->eq('project_id', $project_id) |
||
205 | ->eq('role_id', $role_id) |
||
206 | ->remove(); |
||
207 | |||
208 | if ($r1 && $r2 && $r3) { |
||
209 | $this->db->closeTransaction(); |
||
0 ignored issues
–
show
The property
db does not exist on object<Jitamin\Model\ProjectRoleModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
210 | |||
211 | return true; |
||
212 | } |
||
213 | |||
214 | $this->db->cancelTransaction(); |
||
0 ignored issues
–
show
The property
db does not exist on object<Jitamin\Model\ProjectRoleModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
215 | |||
216 | return false; |
||
217 | } |
||
218 | } |
||
219 |
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.