public function CreateUML($saveName, $umlString, $username) { $uml = new Uml(); $uml->SetSaveName($saveName); $uml->SetUmlString($umlString); $uml->SetUsername($username); $umlRepository = new UMLRepository(); $umlRepository->add($uml); }
public function deleteProject(Uml $uml) { try { $db = $this->connection(); $sql = "DELETE FROM " . self::$dbTable . " WHERE " . self::$userID . " = ? AND " . self::$projectName . " = ?"; $params = array($uml->GetUserID(), $uml->GetSaveName()); $query = $db->prepare($sql); $query->execute($params); } catch (\PDOException $e) { throw new DeleteProjextException(); } }
public function deleteUmlProject($sessionModel) { $projectView = new ProdjectsView(); // Get projectname from view. if ($projectName = $projectView->GetProjectName()) { try { $uml = new Uml(); $uml->SetSaveName($projectName); // Get userID from UserRepository and then populate to UML object. $username = $sessionModel->GetUser(); $userRepository = new UserRepository(); $user = $userRepository->getUserByUsername($username); $uml->SetUserID($user->GetUserID()); // Delete project by UserID and projectName. $this->umlRepository->deleteProject($uml); $this->memberView->deleteMSG($uml->GetSaveName()); } catch (DeleteProjextException $e) { $this->memberView->errorDeleteMSG(); } } }