Updated documentation + started to add some documentation
continuous-integration/drone/push Build is passing Details

pull/16/head
Maël DAIM 1 year ago
parent d824f17ea7
commit 1b9a873cdc

@ -12,12 +12,14 @@ class Team {
} }
Team --> "- mainColor" Color Team --> "- mainColor" Color
Team --> "- secondaryColor" Color Team --> "- secondColor" Color
class Color { class Color {
- value: int - value: string
- __construct(value : string)
+ getValue(): int + getValue(): string
+ from(value: string): Color
+ tryFrom(value : string) : ?Color
} }
class TeamGateway{ class TeamGateway{
@ -31,15 +33,11 @@ TeamGateway *--"- con" Connexion
TeamGateway ..> Color TeamGateway ..> Color
class TeamModel{ class TeamModel{
+ ERROR_INVALID_COLOR : int {readOnly}
+ ERROR_INVALID_NAME : int {readOnly}
+ ERROR_INVALID_PICTURE : int {readOnly}
+ ERROR_INVALID_SEARCH : int {readOnly}
+ ERROR_NO_DATA_FOUND : int {readOnly}
--- ---
+ __construct(gateway : TeamGateway) + __construct(gateway : TeamGateway)
+ createTeam(name : string,picture : string, mainColorValue : int, secondColorValue : int, errors : array) + createTeam(name : string,picture : string, mainColorValue : int, secondColorValue : int, errors : array)
+ listByName(name : string ,errors : array) : ?array + listByName(name : string ,errors : array) : ?array
+ displayTeam(id : int): Team
} }
TeamModel *--"- gateway" TeamGateway TeamModel *--"- gateway" TeamGateway
@ -50,8 +48,11 @@ class TeamController{
- twig : Environement - twig : Environement
-- --
+ __construct( model : TeamModel, twig : Environement) + __construct( model : TeamModel, twig : Environement)
+ submitTeam(request : array) + displaySubmitTeam() : HttpResponse
+ listTeamByName(request : array) + submitTeam(request : array) : HttpResponse
+ displayListTeamByName(): HttpResponse
+ listTeamByName(request : array) : HttpResponse
+ displayTeam(id : int): HttpResponse
} }
TeamController *--"- model" TeamModel TeamController *--"- model" TeamModel
@ -62,7 +63,6 @@ class Connexion{
+ __constructor(pdo : PDO) + __constructor(pdo : PDO)
+ exec(query : string, args : array) + exec(query : string, args : array)
+ fetch(query string, args array): array + fetch(query string, args array): array
} }
@enduml @enduml

@ -10,7 +10,7 @@ use App\Validation\FieldValidationFail;
use App\Validation\Validators; use App\Validation\Validators;
use \Twig\Environment; use \Twig\Environment;
class TeamController /* verif si les camp sont assignés, sinon erreur 400*/ class TeamController
{ {
private TeamModel $model; private TeamModel $model;
private Environment $twig; private Environment $twig;
@ -24,7 +24,7 @@ class TeamController /* verif si les camp sont assignés, sinon erreur 400*/
$this->twig = $twig; $this->twig = $twig;
} }
public function displaySubmitTeam() { public function displaySubmitTeam() : HttpResponse {
return ViewHttpResponse::twig("insert_team.html.twig", []); return ViewHttpResponse::twig("insert_team.html.twig", []);
} }

@ -4,6 +4,16 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Twig view</title> <title>Twig view</title>
<style> <style>
body{
background-color: #f1f1f1;
display: flex;
flex-direction: column;
}
section{
width: 80%;
}
.square{ .square{
width:50px; width:50px;
height:50px; height:50px;
@ -15,10 +25,24 @@
#secondColor{ #secondColor{
background-color: {{ team.secondColor.getValue() }}; background-color: {{ team.secondColor.getValue() }};
} }
.container{
background-color: #fff;
}
.team{
border-color: darkgrey;
border-radius: 20px;
}
</style> </style>
</head> </head>
<body> <body>
<header>
<h1><a href="/">IQBall</a></h1>
</header>
<section class="container">
<div class="team">
<h1>{{ team.name }}</h1> <h1>{{ team.name }}</h1>
<img src="{{ team.picture }}" alt="Logo d'équipe"> <img src="{{ team.picture }}" alt="Logo d'équipe">
<div class="square" id="mainColor"></div> <div class="square" id="mainColor"></div>
@ -27,6 +51,8 @@
{% for m in team.members %} {% for m in team.members %}
<p> m.id </p> <p> m.id </p>
{% endfor %} {% endfor %}
</div>
</section>
</body> </body>
</html> </html>
Loading…
Cancel
Save