diff --git a/GamePedia/src/modeles/Client.php b/GamePedia/src/modeles/Client.php deleted file mode 100644 index ec48fcd9762810034ad2068d49028e5b36576aaa..0000000000000000000000000000000000000000 --- a/GamePedia/src/modeles/Client.php +++ /dev/null @@ -1,9 +0,0 @@ -<?php -namespace gp\modeles; -class Client extends \Illuminate\Database\Eloquent\Model -{ - protected $table = 'client'; - protected $primaryKey = 'idCli'; - public $timestamps = false ; - -} \ No newline at end of file diff --git a/GamePedia/src/modeles/Company.php b/GamePedia/src/modeles/Company.php index 0d7ed575cb86defbef5e6470069f3bb829573120..b5324928311bd353c716e0d652f4dbc1ca4f5031 100644 --- a/GamePedia/src/modeles/Company.php +++ b/GamePedia/src/modeles/Company.php @@ -5,4 +5,8 @@ class Company extends \Illuminate\Database\Eloquent\Model protected $table = 'company'; protected $primaryKey='id'; public $timestamps = false; + + function games(){ + return $this->BelongsToMany('gp\modeles\Game', 'game2company','company_id'); + } } diff --git a/GamePedia/src/modeles/Game_rating.php b/GamePedia/src/modeles/Game_rating.php new file mode 100644 index 0000000000000000000000000000000000000000..d11d362b79eeb38029b6f9dd693bb5b75ff61598 --- /dev/null +++ b/GamePedia/src/modeles/Game_rating.php @@ -0,0 +1,16 @@ +<?php +namespace gp\modeles; +class Game_rating extends \Illuminate\Database\Eloquent\Model +{ + protected $table = 'game_rating'; + protected $primaryKey ='id'; + public $timestamps = false; + + function games(){ + return $this->BelongsToMany('gp\modeles\Game', 'game2rating','rating_id'); + } + + function rating_board(){ + return $this->BelongsTo('gp\modeles\Rating_board', 'id'); + } +} diff --git a/GamePedia/src/modeles/Genre.php b/GamePedia/src/modeles/Genre.php index da686bafc63340bd9936e74903001a032de8c4e0..0700c6f00d3df547fd1008b7c147112ee7caa26f 100644 --- a/GamePedia/src/modeles/Genre.php +++ b/GamePedia/src/modeles/Genre.php @@ -6,4 +6,8 @@ class Genre extends \Illuminate\Database\Eloquent\Model protected $table = 'genre'; protected $primaryKey = 'id'; public $timestamps = false ; + + function games(){ + return $this->BelongsToMany('gp\modeles\Game', 'game2genre','genre_id'); + } } \ No newline at end of file diff --git a/GamePedia/src/modeles/Platform.php b/GamePedia/src/modeles/Platform.php index 93fd3e935a6f5c58fd656358b489729b368b7cb3..61bcc643975686eedd2e50ba93a53cdaa4cfb876 100644 --- a/GamePedia/src/modeles/Platform.php +++ b/GamePedia/src/modeles/Platform.php @@ -6,4 +6,8 @@ class Platform extends \Illuminate\Database\Eloquent\Model protected $table = 'platform'; protected $primaryKey = 'id'; public $timestamps = false ; + + function games(){ + return $this->BelongsToMany('gp\modeles\Game', 'game2platform','platform_id'); + } } \ No newline at end of file diff --git a/GamePedia/src/modeles/Rating_board.php b/GamePedia/src/modeles/Rating_board.php new file mode 100644 index 0000000000000000000000000000000000000000..abf29c6a9c7a2cef48e0495342ae081052526811 --- /dev/null +++ b/GamePedia/src/modeles/Rating_board.php @@ -0,0 +1,16 @@ +<?php + + +namespace gp\modeles; + + +class Rating_board extends \Illuminate\Database\Eloquent\Model +{ + protected $table = 'rating_board'; + protected $primaryKey ='id'; + public $timestamps = false; + + function rating_board(){ + return $this->hasMany('gp\modeles\Game_rating', 'id'); + } +} \ No newline at end of file diff --git a/GamePedia/src/modeles/Theme.php b/GamePedia/src/modeles/Theme.php index 3828bb45db07cbc3171ef8a1c1deb802276c9a75..cd33370163cba06f69e373b41655bd4247549a30 100644 --- a/GamePedia/src/modeles/Theme.php +++ b/GamePedia/src/modeles/Theme.php @@ -5,4 +5,8 @@ class Theme extends \Illuminate\Database\Eloquent\Model protected $table = 'theme'; protected $primaryKey ='id'; public $timestamps = false; + + function games(){ + return $this->BelongsToMany('gp\modeles\Game', 'game2theme','theme_id'); + } }