Commit ebda51d2 authored by KELBERT Paul's avatar KELBERT Paul
Browse files

fin partie 1

parent 40cff0ce
<?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
<?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
......@@ -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>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment