From ebda51d26837deb4e12bdf3caa6e1b55b181dcaa Mon Sep 17 00:00:00 2001
From: PaulKelbert <paul.kelbert3@etu.univ-lorraine.fr>
Date: Mon, 23 Mar 2020 11:59:58 +0100
Subject: [PATCH] fin partie 1
---
Seance5-6/seance/src/modele/Commentary.php | 24 ----------------
Seance5-6/seance/src/modele/User.php | 33 ----------------------
Seance5-6/seance/src/view/VuePartie1.php | 12 +++-----
3 files changed, 4 insertions(+), 65 deletions(-)
delete mode 100644 Seance5-6/seance/src/modele/Commentary.php
delete mode 100644 Seance5-6/seance/src/modele/User.php
diff --git a/Seance5-6/seance/src/modele/Commentary.php b/Seance5-6/seance/src/modele/Commentary.php
deleted file mode 100644
index bad1224..0000000
--- a/Seance5-6/seance/src/modele/Commentary.php
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-
-namespace seance\modele;
-
-
-class Commentary extends \Illuminate\Database\Eloquent\Model
-{
- protected $table = 'commentary';
- protected $primaryKey = 'id';
- public $timestamps = false;
-
-
- public function commentaires(){
- return $this->belongsTo('seance\modele\User', 'id');
- }
-
-
- public function commente(){
- return $this->belongsTo('seance\modele\Game', 'id');
- }
-
-
-
-}
\ No newline at end of file
diff --git a/Seance5-6/seance/src/modele/User.php b/Seance5-6/seance/src/modele/User.php
deleted file mode 100644
index e584f48..0000000
--- a/Seance5-6/seance/src/modele/User.php
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-
-namespace seance\modele;
-
-
-class User extends \Illuminate\Database\Eloquent\Model
-{
- protected $table = 'user';
- protected $primaryKey = 'id';
- public $timestamps = false;
-
-
- public function commentaires(){
- return $this->hasMany('seance\modele\Commentary', 'userID');
- }
-
-
-// public function first_appeared_in_game(){
-// return $this->belongsTo('seance\modele\Game', 'id');
-// }
-//
-// public function appears_in(){
-// return $this->belongsToMany('seance\modele\Game', 'game2character', 'character_id', 'game_id');
-// }
-//
-//
-// public function enemies(){
-// return $this->belongsToMany('seance\modele\Character', 'enemies', 'char1_id', 'char2_id');
-// }
-// public function friends(){
-// return $this->belongsToMany('seance\modele\Character', 'friends', 'char1_id', 'char2_id');
-// }
-}
\ No newline at end of file
diff --git a/Seance5-6/seance/src/view/VuePartie1.php b/Seance5-6/seance/src/view/VuePartie1.php
index 101ea1e..1967e6b 100644
--- a/Seance5-6/seance/src/view/VuePartie1.php
+++ b/Seance5-6/seance/src/view/VuePartie1.php
@@ -8,6 +8,9 @@ class VuePartie1
public function __construct($game)
{
+ $game->description = "...";
+ $json = json_encode($game);
+
$this->content = <<< END
<!DOCTYPE html>
<html lang="fr">
@@ -20,15 +23,8 @@ class VuePartie1
</head>
<body>
-{
- "id": $game->id,
- "name": "$game->name",
- "alias": "$game->alias",
- "deck": "$game->deck",
- "description": ...",
- "original_release_date": "$game->original_release_date"
-}
+$json
</body>
--
GitLab