public function createKeysAction() { if (($username = Prosecco_Authentication::getInstance()->loggedInAs()) != false) { $this->view->userName = $username; // Get UID $userMapper = new Application_Model_UserMapper(); $userdata = $userMapper->findByColumn("uname", $username); $uid = $userdata[0]->getUid(); // Get real name $userdata = new Application_Model_UserData(); $userDataMapper = new Application_Model_UserDataMapper(); $userDataMapper->find($uid, $userdata); if ($userdata !== null) { $this->view->realName = $this->buildRealName($userdata->getForename(), $userdata->getSurname()); } else { $this->view->realName = null; } } else { //TODO require authentication } }
public function fetchAll() { $resultSetUser = $this->_userMapper->fetchAll(); $entries = array(); foreach ($resultSetUser as $row) { $entry = new Application_Model_UserComplete(); $entry->setUserModel($row); $userdata = new Application_Model_UserData(); $this->_userDataMapper->find($row->getUid(), $userdata); $entry->setUserDataModel($userdata); $entries[] = $entry; } return $entries; }