diff --git a/.gitignore b/.gitignore index 9a04280fe906d5b860c323a508c541fbf8dce428..b64be15bca3188275ed8d03bb82aa50f94a9920e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,8 @@ -Seance5-6/seance/vendor/* +/Seance5-6/seance/vendor/* -Seance5-6/seance/composer.lock +/Seance5-6/seance/composer.lock -Seance5-6/seance/conf.ini +/Seance5-6/seance/conf.ini .idea/* diff --git a/Seance5-6/seance/src/modele/Commentary.php b/Seance5-6/seance/src/modele/Commentary.php new file mode 100644 index 0000000000000000000000000000000000000000..bad12245a6eca8496034bb586cbece03d1563ebc --- /dev/null +++ b/Seance5-6/seance/src/modele/Commentary.php @@ -0,0 +1,24 @@ +<?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 new file mode 100644 index 0000000000000000000000000000000000000000..e584f483d6617104383eee77d2fd8250287d9bdb --- /dev/null +++ b/Seance5-6/seance/src/modele/User.php @@ -0,0 +1,33 @@ +<?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