예제 #1
0
 /**
  * Maps array to the given {@link User}.
  * <p>
  * Expected properties are:
  * <ul>
  *   <li>id</li>
  *   <li>user</li>
  *   <li>password</li>
  *   <li>status</li>
  * </ul>
  * @param \Air2Java\Model\User $user model
  * @param array $properties to map from.
  */
 public static function map(\Air2Java\Model\User $user, array $properties)
 {
     if (\array_key_exists('id', $properties)) {
         $user->setId($properties['id']);
     }
     if (\array_key_exists('nom', $properties)) {
         $user->setNom($properties['nom']);
         if (\array_key_exists('password', $properties)) {
             $user->setPassword($properties['password']);
             if (\array_key_exists('status', $properties)) {
                 $user->setStatus($properties['status']);
             }
         }
     }
 }
예제 #2
0
 /**
  * Execute an Action
  * @param string $action Action to be donne.
  */
 private function doAction($action)
 {
     $this->user = new \Air2Java\Model\User();
     switch ($action) {
         case "Connect":
             $this->user->setNom($this->requete->existeParametre('username') ? $this->requete->getParametre('username') : null);
             $this->user->setPassword($this->requete->existeParametre('userpass') ? $this->requete->getParametre('userpass') : null);
             $this->user->setStatus($this->connect($this->user));
             break;
         case "Disconnect":
             $this->disconnect();
             break;
         default:
             break;
     }
 }