Code Duplication    Length = 14-15 lines in 2 locations

modules/bataille/app/controller/Marche.php 2 locations

@@ 31-44 (lines=14) @@
28
				->orderBy("_bataille_marche_transport.aller", "DESC")
29
				->get();
30
31
			if ((is_array($query)) && (count($query) > 0)) {
32
				foreach ($query as $obj) {
33
					$this->id_base_dest = $obj->ID_base_dest;
34
					$this->aller = $obj->aller;
35
					$this->ressources = $obj->ressources;
36
					$this->nom_base = $obj->nom_base;
37
					$this->date_arrivee = $obj->date_arrivee;
38
					$this->id_marche_transport = $obj->ID_marche_transport;
39
40
					$marche[] = $this->getTransportArrive();
41
				}
42
43
				Bataille::setValues(["marche_envoyer" => $marche]);
44
			}
45
46
			//récupération des trajets que l'on va recevoir
47
			$query = $dbc->select()->from("_bataille_marche_transport")
@@ 55-69 (lines=15) @@
52
				->orderBy("_bataille_marche_transport.aller", "DESC")
53
				->get();
54
55
			if ((is_array($query)) && (count($query) > 0)) {
56
				foreach ($query as $obj) {
57
					$this->id_base_dest = $obj->ID_base_dest;
58
					$this->id_base = $obj->ID_base;
59
					$this->aller = $obj->aller;
60
					$this->ressources = $obj->ressources;
61
					$this->nom_base = $obj->nom_base;
62
					$this->date_arrivee = $obj->date_arrivee;
63
					$this->id_marche_transport = $obj->ID_marche_transport;
64
65
					$marche[] = $this->getTransportArrive();
66
				}
67
68
				Bataille::setValues(["marche_recevoir" => $marche]);
69
			}
70
		}
71
		//-------------------------- END BUILDER ----------------------------------------------------------------------------//
72