| @@ 96-120 (lines=25) @@ | ||
| 93 | /** |
|
| 94 | * fonction qui récupère les commentaires d'un forum en particulier |
|
| 95 | */ |
|
| 96 | private function getCommentaireForum() { |
|
| 97 | $dbc = App::getDb(); |
|
| 98 | ||
| 99 | $query = $dbc->select() |
|
| 100 | ->from("_bataille_faction_forum_commentaire") |
|
| 101 | ->from("identite") |
|
| 102 | ->where("ID_faction_forum", "=", $this->id_forum, "AND") |
|
| 103 | ->where("_bataille_faction_forum_commentaire.ID_identite", "=", "identite.ID_identite", "", true) |
|
| 104 | ->get(); |
|
| 105 | ||
| 106 | if (count($query) > 0) { |
|
| 107 | $commentaires = []; |
|
| 108 | ||
| 109 | foreach ($query as $obj) { |
|
| 110 | $commentaires[] = [ |
|
| 111 | "id_commentaire" => $obj->ID_faction_forum_commentaire, |
|
| 112 | "commentaire" => $obj->commentaire, |
|
| 113 | "date_creation" => $obj->date_creation, |
|
| 114 | "pseudo" => $obj->pseudo |
|
| 115 | ]; |
|
| 116 | } |
|
| 117 | ||
| 118 | Bataille::setValues(["forum_commentaires" => $commentaires]); |
|
| 119 | } |
|
| 120 | } |
|
| 121 | //-------------------------- END GETTER ----------------------------------------------------------------------------// |
|
| 122 | ||
| 123 | ||
| @@ 9-31 (lines=23) @@ | ||
| 6 | ||
| 7 | class RelationFaction extends Faction { |
|
| 8 | //-------------------------- GETTER ----------------------------------------------------------------------------// |
|
| 9 | public function getListeRelation() { |
|
| 10 | $dbc = App::getDb(); |
|
| 11 | ||
| 12 | $query = $dbc->select()->from("_bataille_faction_relation") |
|
| 13 | ->from("_bataille_faction") |
|
| 14 | ->where("_bataille_faction_relation.ID_faction", "=", $this->id_faction, "AND") |
|
| 15 | ->where("_bataille_faction_relation.ID_autre_faction", "=", "_bataille_faction.ID_faction", "", true) |
|
| 16 | ->get(); |
|
| 17 | ||
| 18 | $relations = []; |
|
| 19 | if (count($query) > 0) { |
|
| 20 | foreach ($query as $obj) { |
|
| 21 | $relations[] = [ |
|
| 22 | "id_relation" => $obj->ID_faction_relation, |
|
| 23 | "relation" => $obj->relation, |
|
| 24 | "id_autre_faction" => $obj->ID_autre_faction, |
|
| 25 | "nom_autre_faction" => $obj->nom_faction |
|
| 26 | ]; |
|
| 27 | } |
|
| 28 | } |
|
| 29 | ||
| 30 | Bataille::setValues(["relations" => $relations]); |
|
| 31 | } |
|
| 32 | //-------------------------- END GETTER ----------------------------------------------------------------------------// |
|
| 33 | ||
| 34 | ||