public static function wrap($users) { $userList = array(); foreach( $users as $user ) { $auth = Authentication::getByUserID($id); array_push($userList, new User($user, $auth)); } return $userList; }
public function __get($var) { if( $var == 'favorites' ) { return Order::getByUserFavorites($this->userid); } elseif( $var == 'authentication' ) { return Authentication::getByUserID($this->userid); } elseif( $var == 'Predict' ) { return new Predict($this); } elseif( $var == 'ratings' ) { return Rating::getByUser($this->userid); } elseif( $var == 'views' ) { return View::getByUser($this->userid); } else { return $this->$var; } }
public function __get($var){ if( strtolower($var) == 'authentication' ){ return Authentication::getByUserID($this->userid); } elseif( strtolower($var) == 'contact' ){ return Contact::getByUserID($this->userid); } elseif( strtolower($var) == 'fullname' ){ return $this->fname . " " . $this->lname; } else{ return $this->$var; } }