summaryrefslogtreecommitdiff
path: root/src/model/entities/NonVendue.php
blob: 5a8879e069396c807d55eadb54eda06458c8d785 (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
<?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 // pas nécessaire ici

    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]);
    }
}