Code Duplication    Length = 9-10 lines in 2 locations

lib/backend.php 2 locations

@@ 510-519 (lines=10) @@
507
	 * @param $group
508
	 * @return bool
509
	 */
510
	public function deleteGroup($FOLDER, $group) {
511
		// We actually need to just rename all the notes
512
		$uid = \OC::$server->getUserSession()->getUser()->getUID();
513
		$query = $this->db->executeQuery("SELECT id, name, grouping, mtime FROM *PREFIX*ownnote WHERE deleted=0 and uid=? and grouping=?", Array($uid, $group));
514
		$results = $query->fetchAll();
515
		foreach ($results as $result) {
516
			$this->renameNote($FOLDER, $result['id'], $result['name'], '');
517
		}
518
		return true;
519
	}
520
521
	/**
522
	 * @param $FOLDER
@@ 527-535 (lines=9) @@
524
	 * @param $newgroup
525
	 * @return bool
526
	 */
527
	public function renameGroup($FOLDER, $group, $newgroup) {
528
		$uid = \OC::$server->getUserSession()->getUser()->getUID();
529
		$query = $this->db->executeQuery("SELECT id, name, grouping, mtime FROM *PREFIX*ownnote WHERE deleted=0 and uid=? and grouping=?", Array($uid, $group));
530
		$results = $query->fetchAll();
531
		foreach ($results as $result) {
532
			$this->renameNote($FOLDER, $result['id'], $result['name'], $newgroup);
533
		}
534
		return true;
535
	}
536
537
	/**
538
	 * @return string