Commit 9f3f8ce8 authored by KELBERT Paul's avatar KELBERT Paul
Browse files

seance 3

parent 75507679
<?php
require 'vendor/autoload.php';
use seance\reponse\CQuestion1;
$q = new CQuestion1();
\ No newline at end of file
<?php
require 'vendor/autoload.php';
use seance\reponse\CQuestion2;
$q = new CQuestion2();
\ No newline at end of file
<?php
require 'vendor/autoload.php';
use seance\reponse\CQuestion3;
$q = new CQuestion3();
\ No newline at end of file
<?php
require 'vendor/autoload.php';
use seance\reponse\CQuestion4;
$q = new CQuestion4();
\ No newline at end of file
<?php
require 'vendor/autoload.php';
use seance\reponse\CQuestion5;
$q = new CQuestion5();
\ No newline at end of file
<?php
require 'vendor/autoload.php';
use seance\reponse\CQuestion6;
$q = new CQuestion6();
\ No newline at end of file
<?php
require 'vendor/autoload.php';
use seance\reponse\CQuestion7;
$q = new CQuestion7();
\ No newline at end of file
{
"require":{
"illuminate/database": "5.5.*",
"php": ">=7.3"
},
"autoload":{
"psr-4": {
"seance\\" : "src/"
}
}
}
This diff is collapsed.
driver=mysql
username=root
password=
host=localhost
database=applibd
\ No newline at end of file
<?php
require 'vendor/autoload.php';
use seance\modele\Game;
echo "<h1>PARTIE 1</h1>";
echo "<a href='Question1.php'>question 1 -- afficher tous les jeux</a><br>";
echo "<a href='Question2.php'>question 2 -- afficher tous les jeux dont le nom contient mario</a><br>";
echo "<a href='Question3.php'>question 3 -- afficher tous les jeux dont le nom débute par mario</a><br>";
echo "<a href='Question4.php'>question 4 -- afficher tous les jeux dont le nom débute par mario et dont le rating initial contient +3</a><br>";
echo "<a href='Question5.php'>question 5 -- temps d'exécution pour la recherche de jeux avec 3 valeurs différentes</a><br>";
echo "<a href='Question6.php'>question 6 -- temps d'exécution pour la recherche des compagnies dans 3 pays différents</a><br>";
echo "<h1>PARTIE 2</h1>";
echo "<a href='Question7.php'>question 1 -- Réponses partie 2</a><br>";
This diff is collapsed.
<?php
namespace seance\modele;
class Character extends \Illuminate\Database\Eloquent\Model
{
protected $table = 'character';
protected $primaryKey = 'id';
public $timestamps = false;
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
<?php
namespace seance\modele;
class Company extends \Illuminate\Database\Eloquent\Model
{
protected $table = 'company';
protected $primaryKey = 'id';
public $timestamps = false;
public function developers(){
return $this->belongsToMany('seance\modele\Game', 'game_developers', 'comp_id', 'game_id');
}
public function publishers(){
return $this->belongsToMany('seance\modele\Game', 'game_publishers', 'comp_id', 'game_id');
}
public function producer(){
return $this->hasMany('seance\modele\Platform', 'id');
}
}
\ No newline at end of file
<?php
namespace seance\modele;
class Game extends \Illuminate\Database\Eloquent\Model
{
protected $table = 'game';
protected $primaryKey = 'id';
public $timestamps = false;
public function appears_in(){
return $this->belongsToMany('seance\modele\Character', 'game2character', 'game_id', 'character_id');
}
public function first_appeared_in_game(){
return $this->hasMany('seance\modele\Character', 'id');
}
public function simular_games(){
return $this->belongsToMany('seance\modele\Game', 'similar_games', 'game1_id', 'game2_id');
}
public function developers(){
return $this->belongsToMany('seance\modele\Company', 'game_developers', 'game_id', 'comp_id');
}
public function publishers(){
return $this->belongsToMany('seance\modele\Company', 'game_publishers', 'game_id', 'comp_id');
}
public function original_game_ratings(){
return $this->belongsToMany('seance\modele\Game_Rating', "game2rating", 'game_id', 'rating_id');
}
public function game2genre(){
return $this->belongsToMany('seance\modele\Genre', 'game2genre', 'game_id', 'genre_id');
}
public function game2theme(){
return $this->belongsToMany('seance\modele\Theme', 'game2theme', 'game_id', 'theme_id');
}
public function game2platform(){
return $this->belongsToMany('seance\modele\Platform', 'game2platform', 'game_id', 'platform_id');
}
}
\ No newline at end of file
<?php
namespace seance\modele;
class Game_Rating extends \Illuminate\Database\Eloquent\Model
{
protected $table = 'game_rating';
protected $primaryKey = 'id';
public $timestamps = false;
protected $fillable = [
"name",
"rating_board_id"
];
public function original_game_ratings(){
return $this->belongsToMany('seance\modele\Game', "game2rating", 'rating_id', 'game_id');
}
public function gameR2ratB(){
return $this->belongsTo('seance\modele\Rating_Board', 'id');
}
}
\ No newline at end of file
<?php
namespace seance\modele;
class Genre extends \Illuminate\Database\Eloquent\Model
{
protected $table = 'genre';
protected $primaryKey = 'id';
public $timestamps = false;
public function game2genre(){
return $this->belongsToMany('seance\modele\Game', 'game2genre', 'genre_id', 'game_id');
}
}
\ No newline at end of file
<?php
namespace seance\modele;
class Platform extends \Illuminate\Database\Eloquent\Model
{
protected $table = 'platform';
protected $primaryKey = 'id';
public $timestamps = false;
public function producer(){
return $this->belongsTo('seance\modele\Company', 'id');
}
public function game2platform(){
return $this->belongsToMany('seance\modele\Game', 'game2platform', 'platform_id', 'game_id');
}
}
\ No newline at end of file
<?php
namespace seance\modele;
class Rating_Board extends \Illuminate\Database\Eloquent\Model
{
protected $table = 'rating_board';
protected $primaryKey = 'id';
public $timestamps = false;
public function gameR2ratB(){
return $this->hasMany('seance\modele\Game_Rating', 'id');
}
}
\ No newline at end of file
<?php
namespace seance\modele;
class Theme extends \Illuminate\Database\Eloquent\Model
{
protected $table = 'theme';
protected $primaryKey = 'id';
public $timestamps = false;
public function game2theme(){
return $this->belongsToMany('seance\modele\Game', 'game2theme', 'theme_id', 'game_id');
}
}
\ No newline at end of file
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