build : Class base skeleton :D

master
Jade VAN BRABANDT 2 years ago
parent dadfbb7164
commit 696cb791a5

@ -1,18 +0,0 @@
<?php
class Administrator
{
private int $id;
private string $username;
public function __construct(int $id, string $username)
{
$this->id = $id;
$this->username = $username;
}
public function getUsername()
{
return $this->username;
}
}

@ -0,0 +1,32 @@
<?php
class Administrator
{
private int $id;
private string $username;
private string $hashedPassword;
public function __construct(int $id, string $username, string $password)
{
$this->id = $id;
$this->username = $username;
try {
$this->hashedPassword = $hashedPassword = password_hash($password, PASSWORD_BCRYPT, ['cost' => 12]);
} catch (Exception $e) {
echo $e->getMessage();
}
}
public function getUsername()
{
return $this->username;
}
public function getHashedPassword()
{
return $this->hashedPassword;
}
public function setHashedPassword(string $hashedPassword)
{
$this->hashedPassword = $hashedPassword;
}
}

@ -0,0 +1,22 @@
<?php
class Answer
{
private int $id;
private string $content;
public function __construct(int $id, string $content)
{
$this->id = $id;
$this->content = $content;
}
public function getContent()
{
return $this->content;
}
public function setContent(string $content)
{
$this->content = $content;
}
}

@ -0,0 +1,18 @@
<?php
class Chapter
{
private int $id;
private string $name;
public function __construct(int $id, string $name)
{
$this->id = $id;
$this->name = $name;
}
public function getName()
{
return $this->name;
}
}

@ -0,0 +1,31 @@
<?php
class Lobby
{
private int $id;
private string $name;
private string $password;
private int $nbPlayer;
public function __construct(int $id, string $name, string $password, int $nbPlayer)
{
$this->id = $id;
$this->name = $name;
$this->password = $password;
$this->nbPlayer = $nbPlayer;
}
public function getName()
{
return $this->name;
}
public function getNbPlayer()
{
return $this->nbPlayer;
}
public function setNbplayer(int $nbPlayer)
{
$this->nbPlayer = $nbPlayer;
}
}

@ -0,0 +1,33 @@
<?php
class Player
{
private int $id;
private string $nickname;
private string $hashedPassword;
public function __construct(int $id, string $nickname, string $password)
{
$this->id = $id;
$this->nickname = $nickname;
try {
$this->hashedPassword = $hashedPassword = password_hash($password, PASSWORD_BCRYPT, ['cost' => 12]);
} catch (Exception $e) {
echo $e->getMessage();
}
}
public function getNickname()
{
return $this->nickname;
}
public function getHashedPassword()
{
return $this->hashedPassword;
}
public function setHashedPassword(string $hashedPassword)
{
$this->hashedPassword = $hashedPassword;
}
}

@ -0,0 +1,44 @@
<?php
class Question
{
private int $id;
private string $content;
private int $difficulty;
private int $nbFails;
public function __construct(int $id, string $content, int $difficulty = 1, int $nbFails = 0)
{
$this->id = $id;
$this->content = $content;
$this->difficulty = $difficulty;
$this->nbFails = $nbFails;
}
public function getContent()
{
return $this->content;
}
public function setContent(string $content)
{
$this->content = $content;
}
public function getDifficulty()
{
return $this->difficulty;
}
public function setDifficulty(int $difficulty)
{
$this->difficulty = $difficulty;
}
public function getNbFails()
{
return $this->nbFails;
}
public function setNbFails(int $nbFails)
{
$this->nbFails = $nbFails;
}
}

@ -2,14 +2,14 @@
//préfixe
$rep= __DIR__ . '/../';
$rep = __DIR__ . '/../';
//BD
$user= 'jeducourth';
$pass='achanger';
$dsn='mysql:host=localhost;dbname=dbjeducourth';
$user = 'jeducourth';
$pass = 'achanger';
$dsn = 'mysql:host=localhost;dbname=dbjeducourth';
//Vues
$vues['erreur'] ='vues/erreur.php';
$vues['listeNews'] ='vues/listeNews.php';
$vues['connexionView'] ='vues/connexionView.php';
$vues['Administratoristration'] ='vues/Administratoristration.php';
$vues['erreur'] = 'vues/erreur.php';
$vues['listeNews'] = 'vues/listeNews.php';
$vues['connexionView'] = 'vues/connexionView.php';
$vues['Administration'] = 'vues/Administration.php';

Loading…
Cancel
Save