Code Duplication    Length = 10-10 lines in 2 locations

micro/controllers/rest/RestController.php 2 locations

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