Code Duplication    Length = 10-10 lines in 2 locations

micro/controllers/rest/RestController.php 2 locations

@@ 168-177 (lines=10) @@
165
	 * @param boolean $useCache
166
	 * @throws \Exception
167
	 */
168
	public function getOneToMany($member,$useCache=false){
169
		if(isset($_SESSION["_restInstance"])){
170
			$useCache=StrUtils::isBooleanTrue($useCache);
171
			$datas=DAO::getOneToMany($_SESSION["_restInstance"], $member,null,$useCache);
172
			$datas=\array_map(function($o){return $o->_rest;}, $datas);
173
			echo $this->responseFormatter->get($datas);
174
		}else{
175
			throw new \Exception("You have to call getOne before calling getOneToMany.");
176
		}
177
	}
178
179
	/**
180
	 * @param string $member
@@ 184-193 (lines=10) @@
181
	 * @param boolean $useCache
182
	 * @throws \Exception
183
	 */
184
	public function getManyToMany($member,$useCache=false){
185
		if(isset($_SESSION["_restInstance"])){
186
			$useCache=StrUtils::isBooleanTrue($useCache);
187
			$datas=DAO::getManyToMany($_SESSION["_restInstance"], $member,null,$useCache);
188
			$datas=\array_map(function($o){return $o->_rest;}, $datas);
189
			echo $this->responseFormatter->get($datas);
190
		}else{
191
			throw new \Exception("You have to call getOne before calling getManyToMany.");
192
		}
193
	}
194
195
	/**
196
	 * Update an instance of $model selected by the primary key $keyValues