ADD #143 (80%)
[cl7.git] / php / participant.php
index e2b47be..e940f74 100644 (file)
@@ -20,6 +20,19 @@ class Participant
      */
    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;
@@ -36,18 +49,12 @@ class Participant
          $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;