/** * This function is used to perform the add new user in database. It's necessary * because the createAdmin function does not need to test if user is allowed * * @return User_Model_Role * @throws Exception */ private function _add() { try { $u = new User_Persist_Dao_Role(); $u->beginTransaction(); $app = $this->_role->getAppAccount(); if (!isset($app) || !$app->getId()) { throw new Agana_Exception('An App Account must be provided to include a new role'); } $u->setUseTransaction(false); $res = $u->save($this->_role); $u->commit(); return $res; } catch (Exception $e) { $u->rollback(); throw $e; } }