|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* Copyright (c) 2016 Francois-Xavier Soubirou. |
|
5
|
|
|
* |
|
6
|
|
|
* This file is part of eco4. |
|
7
|
|
|
* |
|
8
|
|
|
* eco4 is free software: you can redistribute it and/or modify |
|
9
|
|
|
* it under the terms of the GNU General Public License as published by |
|
10
|
|
|
* the Free Software Foundation, either version 3 of the License, or |
|
11
|
|
|
* (at your option) any later version. |
|
12
|
|
|
* |
|
13
|
|
|
* eco4 is distributed in the hope that it will be useful, |
|
14
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16
|
|
|
* GNU General Public License for more details. |
|
17
|
|
|
* |
|
18
|
|
|
* You should have received a copy of the GNU General Public License |
|
19
|
|
|
* along with eco4. If not, see <http://www.gnu.org/licenses/>. |
|
20
|
|
|
*/ |
|
21
|
|
|
declare(strict_types=1); |
|
22
|
|
|
|
|
23
|
|
|
namespace AppBundle\Entity; |
|
24
|
|
|
|
|
25
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
26
|
|
|
use FOS\UserBundle\Model\User as BaseUser; |
|
27
|
|
|
|
|
28
|
|
|
/** |
|
29
|
|
|
* User entity class. |
|
30
|
|
|
* |
|
31
|
|
|
* @category Eco4 App |
|
32
|
|
|
* |
|
33
|
|
|
* @author Francois-Xavier Soubirou <[email protected]> |
|
34
|
|
|
* @copyright 2016 Francois-Xavier Soubirou |
|
35
|
|
|
* @license http://www.gnu.org/licenses/ GPLv3 |
|
36
|
|
|
* |
|
37
|
|
|
* @link https://www.eco4.io |
|
38
|
|
|
* |
|
39
|
|
|
* @ORM\Table(name="eco4_user") |
|
40
|
|
|
* @ORM\Entity |
|
41
|
|
|
*/ |
|
42
|
|
|
class User extends BaseUser |
|
43
|
|
|
{ |
|
44
|
|
|
/** |
|
45
|
|
|
* @var int |
|
46
|
|
|
* |
|
47
|
|
|
* @ORM\Id |
|
48
|
|
|
* @ORM\Column(type="integer") |
|
49
|
|
|
* @ORM\GeneratedValue(strategy="AUTO") |
|
50
|
|
|
*/ |
|
51
|
|
|
protected $id; |
|
52
|
|
|
|
|
53
|
|
|
/** |
|
54
|
|
|
* @ORM\OneToOne(targetEntity="AppBundle\Entity\Mine", cascade={"remove", "persist"}) |
|
55
|
|
|
*/ |
|
56
|
|
|
protected $mine; |
|
57
|
|
|
|
|
58
|
|
|
/** |
|
59
|
|
|
* Constructor. |
|
60
|
|
|
*/ |
|
61
|
|
|
public function __construct() |
|
62
|
|
|
{ |
|
63
|
|
|
parent::__construct(); |
|
64
|
|
|
// TODO |
|
|
|
|
|
|
65
|
|
|
// $this->mine = new Mine(); |
|
66
|
|
|
} |
|
67
|
|
|
|
|
68
|
|
|
/** |
|
69
|
|
|
* Set mine. |
|
70
|
|
|
* |
|
71
|
|
|
* @param Mine $mine |
|
72
|
|
|
* |
|
73
|
|
|
* @return User |
|
74
|
|
|
*/ |
|
75
|
|
|
public function setMine(Mine $mine): User |
|
76
|
|
|
{ |
|
77
|
|
|
$this->mine = $mine; |
|
78
|
|
|
|
|
79
|
|
|
return $this; |
|
80
|
|
|
} |
|
81
|
|
|
|
|
82
|
|
|
/** |
|
83
|
|
|
* Get mine of user. |
|
84
|
|
|
* |
|
85
|
|
|
* @return Mine |
|
86
|
|
|
*/ |
|
87
|
|
|
public function getMine(): Mine |
|
88
|
|
|
{ |
|
89
|
|
|
return $this->mine; |
|
90
|
|
|
} |
|
91
|
|
|
} |
|
92
|
|
|
|
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.