1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* @copyright Copyright (c) 2017, Matias De lellis <[email protected]> |
4
|
|
|
* @copyright Copyright (c) 2018, Branko Kokanovic <[email protected]> |
5
|
|
|
* |
6
|
|
|
* @author Branko Kokanovic <[email protected]> |
7
|
|
|
* |
8
|
|
|
* @license GNU AGPL version 3 or any later version |
9
|
|
|
* |
10
|
|
|
* This program is free software: you can redistribute it and/or modify |
11
|
|
|
* it under the terms of the GNU Affero General Public License as |
12
|
|
|
* published by the Free Software Foundation, either version 3 of the |
13
|
|
|
* License, or (at your option) any later version. |
14
|
|
|
* |
15
|
|
|
* This program is distributed in the hope that it will be useful, |
16
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
17
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
18
|
|
|
* GNU Affero General Public License for more details. |
19
|
|
|
* |
20
|
|
|
* You should have received a copy of the GNU Affero General Public License |
21
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
22
|
|
|
* |
23
|
|
|
*/ |
24
|
|
|
namespace OCA\FaceRecognition\Db; |
25
|
|
|
|
26
|
|
|
use JsonSerializable; |
27
|
|
|
|
28
|
|
|
use OCP\AppFramework\Db\Entity; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* Person represent one cluster, set of faces. It belongs to $user_id. |
32
|
|
|
* |
33
|
|
|
* @method string getName() |
34
|
|
|
* @method void setName(string $name) |
35
|
|
|
*/ |
36
|
|
|
class Person extends Entity implements JsonSerializable { |
37
|
|
|
/** |
38
|
|
|
* User this person belongs to |
39
|
|
|
* |
40
|
|
|
* @var string |
41
|
|
|
* */ |
42
|
|
|
protected $user; |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* Name for this person/cluster. Must exists, even if linked user is set. |
46
|
|
|
* |
47
|
|
|
* @var string |
48
|
|
|
*/ |
49
|
|
|
protected $name; |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* Whether this person is still valid |
53
|
|
|
* |
54
|
|
|
* @var bool |
55
|
|
|
*/ |
56
|
|
|
protected $isValid; |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* Last timestamp when this person/cluster was created, or when it was refreshed |
60
|
|
|
* |
61
|
|
|
* @var timestamp|null |
|
|
|
|
62
|
|
|
*/ |
63
|
|
|
protected $lastGenerationTime; |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* Foreign key to other user that this person belongs to (if it is on same Nextcloud instance). |
67
|
|
|
* It is set by owner of this cluster. It is optional. |
68
|
|
|
* |
69
|
|
|
* @var string|null |
70
|
|
|
*/ |
71
|
|
|
protected $linkedUser; |
72
|
|
|
|
73
|
|
|
public function jsonSerialize() { |
74
|
|
|
return [ |
75
|
|
|
'id' => $this->id, |
76
|
|
|
'user' => $this->user, |
77
|
|
|
'name' => $this->name, |
78
|
|
|
'is_valid' => $this->isValid, |
79
|
|
|
'last_generation_time' => $this->lastGenerationTime, |
80
|
|
|
'linked_user' => $this->linkedUser |
81
|
|
|
]; |
82
|
|
|
} |
83
|
|
|
|
84
|
1 |
|
public function setIsValid($isValid) { |
85
|
1 |
|
if (is_bool($isValid)) { |
86
|
1 |
|
$this->isValid = $isValid; |
87
|
|
|
} else { |
88
|
|
|
$this->isValid = filter_var($isValid, FILTER_VALIDATE_BOOLEAN); |
89
|
|
|
} |
90
|
1 |
|
$this->markFieldUpdated('isValid'); |
91
|
1 |
|
} |
92
|
|
|
} |
93
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths