blob: a8aa1e83185f8e50008c873e0bccc24cf8a1590c (
plain)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
<?php
// src/model/CESU.php
class CESU extends Model
{
//~ const TABLE = 'cesu';
// lecture des données ou hydratation
protected $ID;
protected $ID_presta;
protected $taches;
protected $duree_travail;
protected $salaire;
public function __construct()
{
$this->table = strtolower(__CLASS__); // cesu
}
public function getAllWithWindowFields(): array // différent de Model::getAll() qui retourne get_object_vars($this)
{
return [
"Numéro CESU:" => $this->ID,
"Tâche effectuée:" => $this->taches,
"Durée du travail:" => $this->duree_travail,
"Salaire:" => $this->salaire];
}
// setters
public function setIDPresta(int $value)
{
$this->ID_presta = $value;
return($this);
}
public function setTaches(string $value)
{
$this->taches = $value;
return($this);
}
public function setDureeTravail(string $value)
{
$this->duree_travail = $value;
return($this);
}
public function setSalaire($value)
{
$value = str_replace(',', '.', $value);
$this->salaire = (float) $value;
return($this);
}
}
|