Blame view

src/Model/Entity/User.php 1 KB
6c4edfa3   Alexandre   First Commit LabI...
1
2
3
4
<?php
namespace App\Model\Entity;

use Cake\ORM\Entity;
64fba1a2   Alexandre   Base du projet : ...
5
use Cake\Auth\DefaultPasswordHasher;
6c4edfa3   Alexandre   First Commit LabI...
6
7

/**
64fba1a2   Alexandre   Base du projet : ...
8
 * User Entity.
6c4edfa3   Alexandre   First Commit LabI...
9
10
11
 *
 * @property int $id
 * @property string $nom
64fba1a2   Alexandre   Base du projet : ...
12
13
 * @property string $username
 * @property string $password
6c4edfa3   Alexandre   First Commit LabI...
14
15
16
17
18
 * @property string $email
 * @property string $role
 * @property int $groupes_metier_id
 * @property \App\Model\Entity\GroupesMetier $groupes_metier
 */
64fba1a2   Alexandre   Base du projet : ...
19
class User extends Entity
6c4edfa3   Alexandre   First Commit LabI...
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{

    /**
     * Fields that can be mass assigned using newEntity() or patchEntity().
     *
     * Note that when '*' is set to true, this allows all unspecified fields to
     * be mass assigned. For security purposes, it is advised to set '*' to false
     * (or remove it), and explicitly make individual fields accessible as needed.
     *
     * @var array
     */
    protected $_accessible = [
        '*' => true,
        'id' => false,
    ];
64fba1a2   Alexandre   Base du projet : ...
35

e1f6c5b7   Alexandre   Version: 2.3.0.0
36
	//Fonction de hachage de mot de passe
64fba1a2   Alexandre   Base du projet : ...
37
38
39
40
    protected function _setPassword($password)
    {
    	return (new DefaultPasswordHasher)->hash($password);
    }
771aa727   Alexandre   Version: 2.3.2.0
41
    
e1f6c5b7   Alexandre   Version: 2.3.0.0
42
    
6c4edfa3   Alexandre   First Commit LabI...
43
}