projects
/
cl7.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ADD #143 (80%)
[cl7.git]
/
php
/
participant.php
diff --git
a/php/participant.php
b/php/participant.php
index
e2b47be
..
e940f74
100644
(file)
--- a/
php/participant.php
+++ b/
php/participant.php
@@
-20,6
+20,19
@@
class Participant
*/
public function Participant($v1=NULL, $v2=NULL)
{
*/
public function Participant($v1=NULL, $v2=NULL)
{
+ $this->authentifier($v1, $v2);
+ }
+
+ /**
+ * Est-ce que le participant existe ? C-à-d qu'il est inscrit.
+ */
+ public function existe()
+ {
+ return $this->id != 0;
+ }
+
+ private function authentifier($v1=NULL, $v2=NULL)
+ {
# Aucunes valeurs transmise => ce n'est pas un participant valide.
if ($v1 == NULL && $v2 == NULL)
return;
# Aucunes valeurs transmise => ce n'est pas un participant valide.
if ($v1 == NULL && $v2 == NULL)
return;
@@
-36,18
+49,12
@@
class Participant
$this->id = pg_fetch_object($res)->id;
$this->chargerInfos();
}
$this->id = pg_fetch_object($res)->id;
$this->chargerInfos();
}
- }
-
- /**
- * Est-ce que le participant existe ? C-à-d qu'il est inscrit.
- */
- public function existe()
- {
- return $this->id != 0;
}
}
- public function chargerInfos()
+ public function chargerInfos(
$v1=NULL, $v2=NULL
)
{
{
+ $this->authentifier($v1, $v2);
+
if (!$this->existe())
return;
if (!$this->existe())
return;