Code Duplication    Length = 9-9 lines in 3 locations

modules/bataille/app/controller/CentreRecherche.php 1 location

@@ 16-24 (lines=9) @@
13
		
14
		
15
		//-------------------------- BUILDER ----------------------------------------------------------------------------//
16
		public function __construct() {
17
			$dbc1 = Bataille::getDb();
18
19
			$query = $dbc1->select("coef_centre_recherche")->from("configuration")->where("ID_configuration", "=", 1)->get();
20
21
			if ((is_array($query)) && (count($query) == 1)) {
22
				foreach ($query as $obj) $this->coef_centre = $obj->coef_centre_recherche;
23
			}
24
		}
25
		//-------------------------- END BUILDER ----------------------------------------------------------------------------//
26
		
27
		

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

@@ 16-24 (lines=9) @@
13
14
		
15
		//-------------------------- BUILDER ----------------------------------------------------------------------------//
16
		public function __construct() {
17
			$dbc1 = Bataille::getDb();
18
19
			$query = $dbc1->select("coef_niveau_unite")->from("configuration")->where("ID_configuration", "=", 1)->get();
20
21
			if ((is_array($query)) && (count($query) == 1)) {
22
				foreach ($query as $obj) $this->coef_unite = $obj->coef_niveau_unite;
23
			}
24
		}
25
		//-------------------------- END BUILDER ----------------------------------------------------------------------------//
26
		
27
		
@@ 82-90 (lines=9) @@
79
		 * @return array
80
		 * fonction qui renvoit tous les types d'unités qu'il est possible de recruter
81
		 */
82
		private function getAllType() {
83
			$dbc1 = Bataille::getDb();
84
85
			$query = $dbc1->select("type_unite")->from("configuration")->where("ID_configuration", "=", 1)->get();
86
87
			if ((is_array($query)) && (count($query) == 1)) {
88
				foreach ($query as $obj) return explode(",", $obj->type_unite);
89
			}
90
		}
91
92
		/**
93
		 * @param $type