object-oriented/login-system/class/database/dao/UserDAO.php
/**
    * Method: select
    *
    * Selects user data from the database.
    *
    * @param string $columns: name of columns to be selected.
    * @param array  $whereColumns: name of columns used as conditions in WHERE clause.
    * @param array  $whereValues: value of columns used as conditions in WHERE clause.
    * @return User.
    *
    * Last Modified: Mar 18, 2019.
    */
select
Selects user data from the database.

@param string $columns: name of columns to be selected.
@param array  $whereColumns: name of columns used as conditions in WHERE clause.
@param array  $whereValues: value of columns used as conditions in WHERE clause.
@return User.


select Selects user data from the database . @param string $columns : name of columns to be selected . @param array $whereColumns : name of columns used as conditions in WHERE clause . @param array $whereValues : value of columns used as conditions in WHERE clause . @return User .
public function select($where = "")
    {
        $user = null;
        $res = parent::select($where);
        if ($res->rowCount() > 0) {
            $user = new User(0, "", "", "");
            foreach ($res->fetchAll() as $userDB) {
                $user->setId($userDB["id"]);
                $user->setEmail($userDB["email"]);
                $user->setUsername($userDB["username"]);
                $user->setPassword($userDB["password"]);
            }
        }
        return $user;
    }
public function select ( $ where = " " ) { $ user = null ; $ res = parent :: select ( $ where ) ; if ( $ res -> rowCount ( ) > 0 ) { $ user = new User ( 0 , " " , " " , " " ) ; foreach ( $ res -> fetchAll ( ) as $ userDB ) { $ user -> setId ( $ userDB [ " id " ] ) ; $ user -> setEmail ( $ userDB [ " email " ] ) ; $ user -> setUsername ( $ userDB [ " username " ] ) ; $ user -> setPassword ( $ userDB [ " password " ] ) ; } } return $ user ; }
Method: select
 Selects user data from the database.
Method : select Selects user data from the database .