Code Duplication    Length = 9-10 lines in 2 locations

lib/backend.php 2 locations

@@ 530-539 (lines=10) @@
527
	 * @param $group
528
	 * @return bool
529
	 */
530
	public function deleteGroup($FOLDER, $group) {
531
		// We actually need to just rename all the notes
532
		$uid = \OC::$server->getUserSession()->getUser()->getUID();
533
		$query = $this->db->executeQuery("SELECT id, name, grouping, mtime FROM *PREFIX*ownnote WHERE deleted=0 and uid=? and grouping=?", Array($uid, $group));
534
		$results = $query->fetchAll();
535
		foreach ($results as $result) {
536
			$this->renameNote($FOLDER, $result['id'], $result['name'], '');
537
		}
538
		return true;
539
	}
540
541
	/**
542
	 * @param $FOLDER
@@ 547-555 (lines=9) @@
544
	 * @param $newgroup
545
	 * @return bool
546
	 */
547
	public function renameGroup($FOLDER, $group, $newgroup) {
548
		$uid = \OC::$server->getUserSession()->getUser()->getUID();
549
		$query = $this->db->executeQuery("SELECT id, name, grouping, mtime FROM *PREFIX*ownnote WHERE deleted=0 and uid=? and grouping=?", Array($uid, $group));
550
		$results = $query->fetchAll();
551
		foreach ($results as $result) {
552
			$this->renameNote($FOLDER, $result['id'], $result['name'], $newgroup);
553
		}
554
		return true;
555
	}
556
557
	/**
558
	 * @return string