Code Duplication    Length = 10-10 lines in 2 locations

micro/controllers/rest/RestController.php 2 locations

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