Ejemplo n.º 1
0
 /**
  * Checks condition of Election registration options and registers candidate
  * as elector too.
  * 
  * Registretion does not start if elections' electors should be in electors
  * groups
  * 
  * @return Elector If registerd, FALSE otherwise
  */
 protected function registerAsElector()
 {
     if ($this->election->autoElectorRegistrationAvailable($this->user_id)) {
         $elector = new Elector();
         $elector->election_id = $this->election_id;
         $elector->user_id = $this->user_id;
         if ($elector->save()) {
             return $elector;
         }
     }
     return false;
 }
Ejemplo n.º 2
0
 protected function createElector()
 {
     $elector = new Elector();
     $elector->user_id = $this->user_id;
     $elector->election_id = $this->election_id;
     $elector->status = Elector::STATUS_ACTIVE;
     $elector->registration_request_id = $this->id;
     $elector->save();
     return $elector;
 }