Skip to content
Snippets Groups Projects
Commit 268f78d9 authored by Nathan's avatar Nathan
Browse files

Ajout des modeles de commentaire et de user

parent 2b5361cb
No related branches found
No related tags found
No related merge requests found
<?php
require 'vendor/autoload.php';
use seance\reponse\CQuestion1;
$q = new CQuestion1();
\ No newline at end of file
<?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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment