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

Ajout des modèles manquants

parent 47493fe0
No related branches found
No related tags found
No related merge requests found
<?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