Code Duplication    Length = 10-10 lines in 2 locations

Ubiquity/controllers/rest/RestController.php 2 locations

@@ 192-201 (lines=10) @@
189
	 * @param boolean $useCache
190
	 * @throws \Exception
191
	 */
192
	public function getOneToMany($member,$included=false,$useCache=false){
193
		if(isset($_SESSION["_restInstance"])){
194
			$included=$this->getIncluded($included);
195
			$useCache=UString::isBooleanTrue($useCache);
196
			$datas=DAO::getOneToMany($_SESSION["_restInstance"], $member,$included,$useCache);
197
			echo $this->responseFormatter->get($datas);
198
		}else{
199
			throw new \Exception("You have to call getOne before calling getOneToMany.");
200
		}
201
	}
202
203
	/**
204
	 * @param string $member
@@ 209-218 (lines=10) @@
206
	 * @param boolean $useCache
207
	 * @throws \Exception
208
	 */
209
	public function getManyToMany($member,$included=false,$useCache=false){
210
		if(isset($_SESSION["_restInstance"])){
211
			$included=$this->getIncluded($included);
212
			$useCache=UString::isBooleanTrue($useCache);
213
			$datas=DAO::getManyToMany($_SESSION["_restInstance"], $member,$included,null,$useCache);
214
			echo $this->responseFormatter->get($datas);
215
		}else{
216
			throw new \Exception("You have to call getOne before calling getManyToMany.");
217
		}
218
	}
219
220
	/**
221
	 * Update an instance of $model selected by the primary key $keyValues