public function render()
{
$view = new UserView();
$view->username = $this->username;
$view->email = $this->email;
$view->first_name = $this->first_name;
$view->last_name = $this->last_name;
$view->identifier = $this->id;
$view->uname = $view->username;
$view->id = $this->id;
$view->attributes = $this->getAttributes();
foreach ($view->attributes as $key => $attribute) {
if (!property_exists($view, $key)) {
$view->{$key} = $attribute;
}
}
return $view;
}