ajout commentaire sur les entity

documentation
Maxime ROCHER 3 months ago
parent 959b47d273
commit 9aaf918073

@ -3,14 +3,14 @@ namespace Entity;
class CharacterEntity
{
// Properties
private int $id_character;
private string $name;
private string $img_path;
/**
* Constructor
*
* @param int $id_character
* @param string $name
* @param string $img_path
@ -23,6 +23,8 @@ class CharacterEntity
}
/**
* Get the character ID
*
* @return int
*/
public function getIdCharacter(): int
@ -31,6 +33,8 @@ class CharacterEntity
}
/**
* Set the character ID
*
* @param int $id_character
*/
public function setIdCharacter(int $id_character): void
@ -39,6 +43,8 @@ class CharacterEntity
}
/**
* Get the character name
*
* @return string
*/
public function getName(): string
@ -47,6 +53,8 @@ class CharacterEntity
}
/**
* Set the character name
*
* @param string $name
*/
public function setName(string $name): void
@ -55,6 +63,8 @@ class CharacterEntity
}
/**
* Get the image path
*
* @return string
*/
public function getImgPath(): string
@ -63,12 +73,12 @@ class CharacterEntity
}
/**
* Set the image path
*
* @param string $img_path
*/
public function setImgPath(string $img_path): void
{
$this->img_path = $img_path;
}
}

@ -13,6 +13,8 @@ class CommentaryEntity {
* @param int $id_comment
* @param string $comment
* @param string $date
* @param string $user
* @param string $img
*/
public function __construct(int $id_comment, string $comment, string $date, string $user, string $img)
{
@ -82,7 +84,7 @@ class CommentaryEntity {
/**
* @param string $user
*/
public function setUser(int $user): void
public function setUser(string $user): void
{
$this->user = $user;
}
@ -98,7 +100,7 @@ class CommentaryEntity {
/**
* @param string $img
*/
public function setImg(int $img): void
public function setImg(string $img): void
{
$this->img = $img;
}

@ -3,10 +3,12 @@ namespace Entity;
class FavoriteEntity
{
private int $id_user;
private int $id_quote;
private int $id_user; // ID of the user
private int $id_quote; // ID of the quote
/**
* Constructor to initialize the FavoriteEntity with user ID and quote ID
*
* @param int $id_user
* @param int $id_quote
*/
@ -17,6 +19,8 @@ class FavoriteEntity
}
/**
* Get the user ID
*
* @return int
*/
public function getIdUser(): int
@ -25,6 +29,8 @@ class FavoriteEntity
}
/**
* Set the user ID
*
* @param int $id_user
*/
public function setIdUser(int $id_user): void
@ -33,6 +39,8 @@ class FavoriteEntity
}
/**
* Get the quote ID
*
* @return int
*/
public function getIdQuote(): int
@ -41,13 +49,12 @@ class FavoriteEntity
}
/**
* Set the quote ID
*
* @param int $id_quote
*/
public function setIdQuote(int $id_quote): void
{
$this->id_quote = $id_quote;
}
}

@ -3,13 +3,14 @@ namespace Entity;
class ImageEntity
{
private int $idImg;
private string $imgPath;
private int $idImg; // ID of the image
private string $imgPath; // Path to the image file
/**
* @param int $idImg
* @param string $imgPath
* @param string $isImgProfile
* Constructor for ImageEntity
*
* @param int $idImg ID of the image
* @param string $imgPath Path to the image file
*/
public function __construct(int $idImg, string $imgPath)
{
@ -17,25 +18,43 @@ class ImageEntity
$this->imgPath = $imgPath;
}
/**
* Get the ID of the image
*
* @return int
*/
public function getIdImg(): int
{
return $this->idImg;
}
/**
* Set the ID of the image
*
* @param int $idImg
*/
public function setIdImg(int $idImg): void
{
$this->idImg = $idImg;
}
/**
* Get the path to the image file
*
* @return string
*/
public function getImgPath(): string
{
return $this->imgPath;
}
/**
* Set the path to the image file
*
* @param string $imgPath
*/
public function setImgPath(string $imgPath): void
{
$this->imgPath = $imgPath;
}
}

@ -1,148 +1,175 @@
<?php
namespace Entity;
namespace Entity;
class QuestionEntity
{
private int $id_question;
private string $question;
private string $answerA;
private string $answerB;
private string $answerC;
private string $answerD;
private string $cAnswer;
/**
* Constructor to initialize the QuestionEntity object.
*
* @param int $id_question The ID of the question.
* @param string $question The question text.
* @param string $answerA The text for answer A.
* @param string $answerB The text for answer B.
* @param string $answerC The text for answer C.
* @param string $answerD The text for answer D.
* @param string $cAnswer The correct answer.
*/
public function __construct(int $id_question, string $question, string $answerA, string $answerB, string $answerC, string $answerD, string $cAnswer)
{
$this->id_question = $id_question;
$this->question = $question;
$this->answerA = $answerA;
$this->answerB = $answerB;
$this->answerC = $answerC;
$this->answerD = $answerD;
$this->cAnswer = $cAnswer;
}
/**
* Get the ID of the question.
*
* @return int The ID of the question.
*/
public function getIdQuestion(): int
{
return $this->id_question;
}
/**
* Set the ID of the question.
*
* @param int $id_question The ID of the question.
*/
public function setIdQuestion(int $id_question): void
{
$this->id_question = $id_question;
}
/**
* Get the question text.
*
* @return string The question text.
*/
public function getQuestion(): string
{
return $this->question;
}
/**
* Set the question text.
*
* @param string $question The question text.
*/
public function setQuestion(string $question): void
{
$this->question = $question;
}
/**
* Get the text for answer A.
*
* @return string The text for answer A.
*/
public function getAnswerA(): string
{
return $this->answerA;
}
/**
* Set the text for answer A.
*
* @param string $answerA The text for answer A.
*/
public function setAnswerA(string $answerA): void
{
$this->answerA = $answerA;
}
class QuestionEntity
/**
* Get the text for answer B.
*
* @return string The text for answer B.
*/
public function getAnswerB(): string
{
private int $id_question;
private string $question;
private string $answerA;
private string $answerB;
private string $answerC;
private string $answerD;
private string $cAnswer;
/**
* @param int $id_question
* @param string $question
* @param string $answerA
* @param string $answerB
* @param string $answerC
* @param string $answerD
* @param string $cAnswer
*/
public function __construct(int $id_question, string $question, string $answerA, string $answerB, string $answerC, string $answerD, string $cAnswer)
{
$this->id_question = $id_question;
$this->question = $question;
$this->answerA = $answerA;
$this->answerB = $answerB;
$this->answerC = $answerC;
$this->answerD = $answerD;
$this->cAnswer = $cAnswer;
}
/**
* @return int
*/
public function getIdQuestion(): int
{
return $this->id_question;
}
/**
* @param int $id_question
*/
public function setIdQuestion(int $id_question): void
{
$this->id_question = $id_question;
}
/**
* @return string
*/
public function getQuestion(): string
{
return $this->question;
}
/**
* @param string $question
*/
public function setQuestion(string $question): void
{
$this->question = $question;
}
/**
* @return string
*/
public function getAnswerA(): string
{
return $this->answerA;
}
/**
* @param string $answerA
*/
public function setAnswerA(string $answerA): void
{
$this->answerA = $answerA;
}
/**
* @return string
*/
public function getAnswerB(): string
{
return $this->answerB;
}
/**
* @param string $answerB
*/
public function setAnswerB(string $answerB): void
{
$this->answerB = $answerB;
}
/**
* @return string
*/
public function getAnswerC(): string
{
return $this->answerC;
}
/**
* @param string $answerC
*/
public function setAnswerC(string $answerC): void
{
$this->answerC = $answerC;
}
/**
* @return string
*/
public function getAnswerD(): string
{
return $this->answerD;
}
/**
* @param string $answerD
*/
public function setAnswerD(string $answerD): void
{
$this->answerD = $answerD;
}
/**
* @return string
*/
public function getCAnswer(): string
{
return $this->cAnswer;
}
/**
* @param string $cAnswer
*/
public function setCAnswer(string $cAnswer): void
{
$this->cAnswer = $cAnswer;
}
return $this->answerB;
}
/**
* Set the text for answer B.
*
* @param string $answerB The text for answer B.
*/
public function setAnswerB(string $answerB): void
{
$this->answerB = $answerB;
}
/**
* Get the text for answer C.
*
* @return string The text for answer C.
*/
public function getAnswerC(): string
{
return $this->answerC;
}
/**
* Set the text for answer C.
*
* @param string $answerC The text for answer C.
*/
public function setAnswerC(string $answerC): void
{
$this->answerC = $answerC;
}
/**
* Get the text for answer D.
*
* @return string The text for answer D.
*/
public function getAnswerD(): string
{
return $this->answerD;
}
/**
* Set the text for answer D.
*
* @param string $answerD The text for answer D.
*/
public function setAnswerD(string $answerD): void
{
$this->answerD = $answerD;
}
/**
* Get the correct answer.
*
* @return string The correct answer.
*/
public function getCAnswer(): string
{
return $this->cAnswer;
}
/**
* Set the correct answer.
*
* @param string $cAnswer The correct answer.
*/
public function setCAnswer(string $cAnswer): void
{
$this->cAnswer = $cAnswer;
}
}

@ -3,14 +3,15 @@ namespace Entity;
class QuizEntity
{
private int $id_quiz;
private int $nb_questions;
// Properties
private int $id_quiz; // ID of the quiz
private int $nb_questions; // Number of questions in the quiz
/**
* @param int $id_quiz
* @param int $nb_questions
* Constructor
*
* @param int $id_quiz ID of the quiz
* @param int $nb_questions Number of questions in the quiz
*/
public function __construct(int $id_quiz, int $nb_questions)
{
@ -19,6 +20,8 @@ class QuizEntity
}
/**
* Get the ID of the quiz
*
* @return int
*/
public function getIdQuiz(): int
@ -27,6 +30,8 @@ class QuizEntity
}
/**
* Set the ID of the quiz
*
* @param int $id_quiz
*/
public function setIdQuiz(int $id_quiz): void
@ -35,6 +40,8 @@ class QuizEntity
}
/**
* Get the number of questions in the quiz
*
* @return int
*/
public function getNbQuestions(): int
@ -43,14 +50,12 @@ class QuizEntity
}
/**
* Set the number of questions in the quiz
*
* @param int $nb_questions
*/
public function setNbQuestions(int $nb_questions): void
{
$this->nb_questions = $nb_questions;
}
}

@ -1,15 +1,16 @@
<?php
namespace Entity;
class QuizQuestionEntity
{
private int $id_question;
private int $id_quiz;
private int $id_question; // ID of the question
private int $id_quiz; // ID of the quiz
/**
* @param int $id_question
* @param int $id_quiz
* Constructor to initialize the QuizQuestionEntity
*
* @param int $id_question ID of the question
* @param int $id_quiz ID of the quiz
*/
public function __construct(int $id_question, int $id_quiz)
{
@ -18,7 +19,9 @@ class QuizQuestionEntity
}
/**
* @return int
* Get the ID of the question
*
* @return int ID of the question
*/
public function getIdQuestion(): int
{
@ -26,7 +29,9 @@ class QuizQuestionEntity
}
/**
* @param int $id_question
* Set the ID of the question
*
* @param int $id_question ID of the question
*/
public function setIdQuestion(int $id_question): void
{
@ -34,7 +39,9 @@ class QuizQuestionEntity
}
/**
* @return int
* Get the ID of the quiz
*
* @return int ID of the quiz
*/
public function getIdQuiz(): int
{
@ -42,13 +49,12 @@ class QuizQuestionEntity
}
/**
* @param int $id_quiz
* Set the ID of the quiz
*
* @param int $id_quiz ID of the quiz
*/
public function setIdQuiz(int $id_quiz): void
{
$this->id_quiz = $id_quiz;
}
}

@ -3,13 +3,29 @@
class Quote{
// Represents the unique identifier for the quote
private int $id;
// The content of the quote
private string $content;
// The characteristic or attribute associated with the quote
private string $carac;
// The file path to the image associated with the quote
private string $imgPath;
// The title source of the quote
private string $titleSrc;
// The date source of the quote
private string $dateSrc;
// The number of likes the quote has received
private int $like;
// The language of the quote
private string $langue;
/**

@ -3,67 +3,111 @@ namespace Entity;
class ResultsEntity
{
// Property to store the quiz ID
private int $idQuiz;
// Property to store the user ID
private int $idUser;
// Property to store the number of points
private int $nbPts;
// Property to store the time
private int $time;
/**
* Constructor to initialize the properties
*
* @param int $idQuiz The ID of the quiz
* @param int $idUser The ID of the user
* @param int $time The time taken
* @param int $nbPts The number of points
*/
public function __construct(int $idQuiz, int $idUser, int $time, int $nbPts)
{
$this->idQuiz = $idQuiz;
$this->idUser = $idUser;
$this->time = $time;
$this->nbPts = $nbPts;
}
/**
* Get the user ID
*
* @return int The ID of the user
*/
public function getIdUser(): int
{
return $this->idUser;
}
/**
* Set the user ID
*
* @param int $idUser The ID of the user
*/
public function setIdUser(int $idUser): void
{
$this->idUser = $idUser;
}
/**
* Get the quiz ID
*
* @return int The ID of the quiz
*/
public function getIdQuiz(): int
{
return $this->idQuiz;
}
/**
* Set the quiz ID
*
* @param int $idQuiz The ID of the quiz
*/
public function setIdQuiz(int $idQuiz): void
{
$this->idQuiz = $idQuiz;
}
/**
* Get the time taken
*
* @return int The time taken
*/
public function getTime(): int
{
return $this->time;
}
/**
* Set the time taken
*
* @param int $time The time taken
*/
public function setTime(int $time): void
{
$this->time = $time;
}
/**
* Get the number of points
*
* @return int The number of points
*/
public function getNbPts(): int
{
return $this->nbPts;
}
public function setNbPts(int $nbPts): void
{
$this->nbPts = $nbPts;
}
private int $idUser;
private int $nbPts;
private int $time;
/**
* @param int $idQuiz
* @param int $idUser
* @param int $time
* @param int $nbPts
* Set the number of points
*
* @param int $nbPts The number of points
*/
public function __construct(int $idQuiz, int $idUser, int $time, int $nbPts)
public function setNbPts(int $nbPts): void
{
$this -> idQuiz = $idQuiz;
$this -> idUser = $idUser;
$this -> time = $time;
$this -> nbPts = $nbPts;
$this->nbPts = $nbPts;
}
}

@ -5,28 +5,33 @@ use Enum\TypeSourceEnum;
class SourceEntity
{
private int $id_source;
private int $id_source; // ID of the source
private string $title;
private string $title; // Title of the source
private string $date;
private string $date; // Date of the source
private TypeSourceEnum $type;
private TypeSourceEnum $type; // Type of the source
/**
* Constructor to initialize the SourceEntity object
*
* @param int $id_source
* @param string $title
* @param string $date
* @param TypeSourceEnum $type
*/
public function __construct(int $id_source, string $title, string $date, TypeSourceEnum $type)
{
$this->id_source = $id_source;
$this->title = $title;
$this->date = $date;
//$this->type = $type;
//$this->type = $type; // Uncomment this line to initialize the type
}
/**
* Get the ID of the source
*
* @return int
*/
public function getIdSource(): int
@ -35,6 +40,8 @@ class SourceEntity
}
/**
* Set the ID of the source
*
* @param int $id_source
*/
public function setIdSource(int $id_source): void
@ -43,6 +50,8 @@ class SourceEntity
}
/**
* Get the title of the source
*
* @return string
*/
public function getTitle(): string
@ -51,6 +60,8 @@ class SourceEntity
}
/**
* Set the title of the source
*
* @param string $title
*/
public function setTitle(string $title): void
@ -59,6 +70,8 @@ class SourceEntity
}
/**
* Get the date of the source
*
* @return string
*/
public function getDate(): string
@ -67,6 +80,8 @@ class SourceEntity
}
/**
* Set the date of the source
*
* @param string $date
*/
public function setDate(string $date): void
@ -74,17 +89,23 @@ class SourceEntity
$this->date = $date;
}
/**
* Get the type of the source
*
* @return TypeSourceEnum
*/
public function getType(): TypeSourceEnum
{
return $this->type;
}
/**
* Set the type of the source
*
* @param TypeSourceEnum $type
*/
public function setType(TypeSourceEnum $type): void
{
$this->type = $type;
}
}

Loading…
Cancel
Save