Code Duplication    Length = 10-10 lines in 2 locations

admin/controller/AdminComment.php 1 location

@@ 58-67 (lines=10) @@
55
				->where("ID_in_table", "=", $id_in_table)->orderBy("checked", "DESC")->get();
56
			
57
			$values = [];
58
			if (count($query) > 0) {
59
				foreach ($query as $obj) {
60
					$values[] = [
61
						"comment" => $obj->comment,
62
						"date" => $obj->date,
63
						"pseudo" => $obj->pseudo,
64
						"id_identite" => $obj->ID_identite,
65
					];
66
				}
67
			}
68
			
69
			$this->setValues($values);
70
		}

app/controller/Comment.php 1 location

@@ 99-108 (lines=10) @@
96
				->where("ID_in_table", "=", $id_in_table, "AND")->where("checked", "=", 1)->get();
97
			
98
			$values = [];
99
			if (count($query) > 0) {
100
				foreach ($query as $obj) {
101
					$values[] = [
102
						"comment" => $obj->comment,
103
						"date" => $obj->date,
104
						"pseudo" => $obj->pseudo,
105
						"id_identite" => $obj->ID_identite,
106
					];
107
				}
108
			}
109
			
110
			$this->table = $table;
111
			$this->id_in_table = $id_in_table;