本文整理汇总了PHP中Adherent::setId方法的典型用法代码示例。如果您正苦于以下问题:PHP Adherent::setId方法的具体用法?PHP Adherent::setId怎么用?PHP Adherent::setId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Adherent
的用法示例。
在下文中一共展示了Adherent::setId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: HTTPRequest
include_once "C:\\wamp\\www\\CMPJ\\Controleurs\\HTTPResponse.php";
include_once "C:\\wamp\\www\\CMPJ\\Model\\AdherentManagerPDO.php";
include_once "C:\\wamp\\www\\CMPJ\\Model\\PDOFactory.php";
$request = new HTTPRequest();
$manager = new AdherentManagerPDO(PDOFactory::getPdoInstance());
if (isset($_GET['modifier'])) {
if (!$manager->Exists((int) $_GET['modifier'])) {
$message = 'NOT FOUND.';
} else {
$adherent = $manager->getUnique((int) $_GET['modifier']);
}
}
if ($request->postExists('nom')) {
//on hydrate les données
$adherent = new Adherent(['nom' => $request->postData('nom'), 'prenom' => $request->postData('prenom'), 'dateNaissance' => $request->postData('date'), 'lieu' => $request->postData('lieuNaissance'), 'sexe' => $request->postData('sexe'), 'region' => $request->postData('region'), 'departement' => $request->postData('departement'), 'ethnie' => $request->postData('ethnie'), 'nationalite' => $request->postData('nationalite'), 'profession_mere_parrain' => $request->postData('profession'), 'situationMatrimoniale' => $request->postData('situation'), 'lieuResidence' => $request->postData('lieuResidence'), 'adresse' => $request->postData('addr'), 'telPerso' => $request->postData('telPerso'), 'sosTel' => $request->postData('sosTel'), 'sosName' => $request->postData('sosName'), 'diplomeEleve' => $request->postData('diplome'), 'dateObtentionPlace' => $request->postData('dateObtention'), 'speakLanguage' => $request->postData('speakLanguage'), 'filiere' => $request->postData('option')]);
$adherent->setId((int) $_GET['modifier']);
if ($adherent->isvalid()) {
$manager->update($adherent);
$message = 'Informations bien modifiées ';
} else {
$erreurs = $adherent->getErreurs();
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Formulaire d'inscription CMPJ MAYO-LOUTI</title>
<meta charset="utf-8" content="text/html">
<link rel="stylesheet" href="css/Envision.css" >
</head>