-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmployeDao.php
More file actions
108 lines (86 loc) · 2.04 KB
/
EmployeDao.php
File metadata and controls
108 lines (86 loc) · 2.04 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?php
require_once 'DAO.php';
/**
* Class EmployeDAO
*/
abstract class EmployeDAO extends EntityBase
{
/**
* Protected variable
* (PK)->Primary key
* @var int $id
*/
protected $id;
public function getId() {return $this->id;}
public function setId($id) {$this->id=$id;}
/**
* Protected variable
* (UQ)->Unique key
* @var varchar $email
*/
protected $email;
public function getEmail() {return $this->email;}
public function setEmail($email) {$this->email=$email;}
/**
* Protected variable
* @var varchar $motDePasse
*/
protected $motDePasse;
public function getMotDePasse() {return $this->motDePasse;}
public function setMotDePasse($motDePasse) {$this->motDePasse=$motDePasse;}
/**
* Protected variable
* (PK)->Primary key
* @var int $idEntreprise
*/
protected $idEntreprise;
public function getIdEntreprise() {return $this->idEntreprise;}
public function setIdEntreprise($idEntreprise) {$this->idEntreprise=$idEntreprise;}
/**
* Protected variable
* @var tinyint $entreprise
*/
protected $entreprise;
public function getEntreprise() {return $this->entreprise;}
public function setEntreprise($entreprise) {$this->entreprise=$entreprise;}
/**
* Constructor
* @var mixed $id
*/
public function __construct($id=0)
{
parent::__construct();
$this->table='employe';
$this->primkeys=['id','idEntreprise'];
$this->fields=['email','motDePasse','entreprise'];
$this->sql="SELECT * FROM {$this->table}";
if($id) $this->read($id);
}
/**
* Column id Finder
* @return object[]
*/
public function findById($id)
{
$sql="SELECT * FROM employe WHERE id='$id'";
return $this->getSelfObjects($sql);
}
/**
* Unique Key Finder
* @return object
*/
public function findByEmail($email)
{
$sql="SELECT * FROM employe WHERE email='$email' LIMIT 1";
return $this->getSelfObject($sql);
}
/**
* Column idEntreprise Finder
* @return object[]
*/
public function findByIdEntreprise($idEntreprise)
{
$sql="SELECT * FROM employe WHERE idEntreprise='$idEntreprise'";
return $this->getSelfObjects($sql);
}
}