/**
  * active a user
  * @param string $email
  */
 public function active($email, $code)
 {
     if ($this->checkEmailExists($email)) {
         $users = $this->currentManager->getByEmail($email);
         if ($users[0]->level == $code) {
             $users[0]->level = 1;
             $users[0]->active = 1;
             $this->currentEntity->hydrate($users[0]);
             if ($this->currentManager->save($this->currentEntity)) {
                 $this->page->addVar('content', _TR_ValidationSuccess);
                 $_SESSION['users'] = $users[0];
             }
         } else {
             \library\handleErrors::setErrors($this->errorElement);
         }
     } else {
         \library\handleErrors::setErrors($this->errorExistingElement);
     }
 }
 /**
  * is valid method.
  * @return bool false=invalid, true=valid
  */
 public function isValid()
 {
     $res = true;
     foreach ($this->validators as $validator) {
         if (!$validator->isValid($this->value)) {
             $error = new \library\error(array('type' => \library\error::TYPE_ERR, 'msg' => $validator->getErrorMsg(), 'div' => 'field_error_msg_' . $this->getName()));
             \library\handleErrors::setErrors($error);
             $res = false;
         }
     }
     return $res;
 }