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
| class Application_Model_DbTable_Utilisateur extends Zend_Db_Table_Abstract
{
protected $_name = 'utilisateur';
protected $_referenceMap = array(
'Soci' => array(
'columns' => 'PK_Nom_societe',
'refTableClass' => 'societe',
'refColumns' => 'ID_societe'
),
'Logi' => array(
'columns' => 'PK_Logiciel',
'refTableClass' => 'logiciel',
'refColumns' => 'ID_Logiciel'
)
);
public function obtenirutilisateur($id)
{
$id = (int)$id;
$row = $this->fetchRow('ID_utilisateur= ' . $id);
if (!$row) {
throw new Exception("Impossible de trouver l'utilisateur $id");
}
return $row->toArray();
}
public function ajouterutilisateur($Mail,$logiciel, $societe )
{
$data = array(
'Mail' => $Mail,
// code pour ajouter logiciel et société ???
);
$this->insert($data);
}
public function modifierutilisateur($id, $Mail,$logiciel, $societe)
{
$data = array(
''Mail' => $Mail,
// code pour modifier logiciel et société ???.
);
$this->update($data, 'ID_utilisateur = '. (int)$id);
}
public function supprimerutilisateur($id)
{
$this->delete('ID_utilisateur =' . (int)$id);
}
} |
Partager