From fc234e44383a54b239d1debca4a02c6efd2f9fe3 Mon Sep 17 00:00:00 2001 From: Yasder5 <102179445+Yasder5@users.noreply.github.com> Date: Wed, 14 Jan 2026 20:52:19 +0100 Subject: [PATCH] =?UTF-8?q?Am=C3=A9loration=20de=20la=20structure=20du=20c?= =?UTF-8?q?ode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/project_controller.php | 33 ++++ app/entities/mother_entity.php | 22 +++ app/entities/project_entity.php | 203 +++++++++++++++++++++++++ app/models/project_model.php | 8 +- app/views/home.php | 17 +++ app/views/partials/header.php | 1 + app/views/partials/project.php | 19 +++ public/index.php | 48 +++--- 8 files changed, 320 insertions(+), 31 deletions(-) create mode 100644 app/controllers/project_controller.php create mode 100644 app/entities/mother_entity.php create mode 100644 app/entities/project_entity.php create mode 100644 app/views/home.php create mode 100644 app/views/partials/project.php diff --git a/app/controllers/project_controller.php b/app/controllers/project_controller.php new file mode 100644 index 0000000..e1353f5 --- /dev/null +++ b/app/controllers/project_controller.php @@ -0,0 +1,33 @@ +findAll(4); + $arrProjectToDiplay = array(); + foreach($arrProject as $arrDetProject){ + $objProject = new Project; + $objProject->hydrate($arrDetProject); + var_dump($objProject); + $arrProjectToDiplay[] = $objProject; + } + + include('../app/views/partials/header.php'); + include('../app/views/home.php'); + include('../app/views/partials/footer.php'); + + } + + } \ No newline at end of file diff --git a/app/entities/mother_entity.php b/app/entities/mother_entity.php new file mode 100644 index 0000000..05eafb0 --- /dev/null +++ b/app/entities/mother_entity.php @@ -0,0 +1,22 @@ +$value){ + $strMethodName = "set".ucfirst(str_replace($this->_prefix,'',$key)); + if (method_exists($this,$strMethodName)){ + $this->$strMethodName($value); + } + } + } + + } \ No newline at end of file diff --git a/app/entities/project_entity.php b/app/entities/project_entity.php new file mode 100644 index 0000000..291bc43 --- /dev/null +++ b/app/entities/project_entity.php @@ -0,0 +1,203 @@ +_prefix = 'project_'; + } + + // Méthode Getter et Setter + + /** + * Récuperation de l'id du Projet + * @return int l'id du projet + */ + public function getId():int{ + return $this->_id; + } + + /** + * Mise à jour de l'id du projet + * @param int le nouvelle id + */ + public function setId($id){ + $this->_id = $id; + } + + /** + * Récuperation du titre + * @return string tite du projet + */ + public function getTitle(){ + return $this->_title; + } + + /** + * Mise à jour du titre + * @param string le nouveau titre + */ + public function setTitle($title){ + $this->_title = $title; + } + + /** + * Récuperation de la description + * @return string description du projet + */ + public function getDescription(){ + return $this->_description; + } + + /** + * Mise à jour de la description + * @param string la nouvelle description + */ + public function setDescription($description){ + $this->_description = $description; + } + + + /** + * Récuperation de l'image + * @return string chemin vers l'image + */ + public function getThumbnail(){ + return $this->_thumbnail; + } + + /** + * Mise à jour de l'image + * @param string chemin vers nouvelle image + */ + public function setThumbnail($thumbnail){ + $this->_thumbnail = $thumbnail; + } + + /** + * Récuperation du contenue + * @return string contenue du projet + */ + public function getContent(){ + return $this->_content; + } + + /** + * Mise à jour du contenue + * @param string le nouveau contenue + */ + public function setContent($content){ + $this->_content = $content; + } + + + /** + * Récupération de la date de création + * @param string lang de formatage de la date (par défaut = "fr_FR") + * @return string date de création formatter + */ + public function getCreation_date(string $strFormat = "fr_FR"){ + $objDate = new DateTime($this->_creation_date); + + $objDateFormatter = new IntlDateFormatter( + $strFormat, + IntlDateFormatter::LONG, + IntlDateFormatter::NONE, + + ); + $strFormat = $objDateFormatter->format($objDate); + return $strFormat; + } + + /** + * Mise à jour de la date de création + * @param string la nouvelle date de création + */ + public function setCreation_date($creation_date){ + $this->_creation_date = $creation_date; + } + + /** + * Récupération du statut + * @return string statut + */ + public function getStatus(){ + return $this->_status; + } + + /** + * Mise à jour du statut + * @param string le nouveau statut + */ + public function setStatus($status){ + $this->_status = $status; + } + + /** + * Récupération de l'utilisateur + * @return int id de l'utilisateur + */ + public function getUser(){ + return $this->_user; + } + + /** + * Mise à jour de l'utilisateur + * @param int id de l'utilisateur + */ + public function setUser($user){ + $this->_user = $user; + } + + /** + * Récupération de la catégorie + * @return int id de la catégorie + */ + public function getCategory(){ + return $this->_category; + } + + /** + * Mise à jour de la catégorie + * @param int id de la catégorie + */ + public function setCategory($category){ + $this->_category = $category; + } + + /** + * Récupération du nom du créateur + * @return string nom du créateur + */ + public function getCreatorName(){ + return $this->_creatorname; + } + + /** + * Mise à jour du nom du créateur + * @param string le nom du créateur + */ + public function setCreatorName($creatorname){ + $this->_creatorname = $creatorname; + } + +} \ No newline at end of file diff --git a/app/models/project_model.php b/app/models/project_model.php index 051a103..a01393d 100644 --- a/app/models/project_model.php +++ b/app/models/project_model.php @@ -1,10 +1,6 @@ +
Une plateforme de portfolio adapté à vos besoins et aux besoins des entreprises. + Créer un portfolio réellement pertinent aux exigences du marché et rentrez + directement en contact avec les entreprises.
+ + +Une plateforme de portfolio adapté à vos besoins et aux besoins des entreprises. - Créer un portfolio réellement pertinent aux exigences du marché et rentrez - directement en contact avec les entreprises.
-