Blame view

src/Model/Entity/Stat.php 1.12 KB
409758d9   Etienne Pallier   Ajout d'une nouve...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
namespace App\Model\Entity;

use Cake\ORM\Entity;

/**
 * Stat Entity
 *
 * @property string $year
 * @property int $user_id
 * @property \Cake\I18n\FrozenTime|null $last_login_time
 * @property \Cake\I18n\FrozenTime|null $last_logout_time
 * @property int $connex_nb
 * @property int $connex_dur
 *
 * @property \App\Model\Entity\User $user
 */
class Stat extends Entity
{
    /**
     * 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 = [
        'last_login_time' => true,
        'last_logout_time' => true,
        'connex_nb' => true,
        'connex_dur' => true,
        'user' => true
    ];
1b901ee9   Etienne Pallier   Refactorisation e...
36
37
38
39
40
41
42
    
    
    // Propriété virtuelle : champ généré par calcul
    // $e->connexDurAvg
    protected function _getConnexDurAvg() { 
        return (int)($this->connex_dur_tot / $this->connex_nb);
    }
409758d9   Etienne Pallier   Ajout d'une nouve...
43
}