blob: d875eb5353db2fc38ae44166c035db9daddb23fe (
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
52
53
54
55
|
<?php
// src/entities/NonVendue.php
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
#[ORM\Table(name: 'non_vendues')]
class NonVendue extends Prestation
{
#[ORM\Column]
private string $taches;
public function getTaches(): string
{
return $this->taches;
}
public function getAllWithWindowFields(): array
{
$common_data = parent::getAllWithWindowFields();
return array_merge($common_data, ["Tâches:" => $this->taches,]);
}
public function setTaches(string $value): NonVendue
{
$this->taches = $value;
return $this;
}
public function set(string $entry, string $input): void
{
$input = $this->cleanSpecialChars($input); // possibilité que $input devienne une chaîne vide
switch($entry)
{
case "Tâches:":
$this->setTaches($input);
break;
default:
parent::set($entry, $input);
}
}
public function validateForm(array $data_array): bool
{
if(count($data_array) === 1){
return true;
}
else{
echo "erreur de NonVendue::validateForm(), le tableau \$data_array n'a pas la taille attendue.\n";
return false;
}
}
public function hydrate(array $data_array): void
{
$this->setTaches($data_array[0]);
}
}
|