Code Duplication    Length = 7-8 lines in 3 locations

lib/private/User/AccountTermMapper.php 1 location

@@ 68-75 (lines=8) @@
65
	 * @param $account_id
66
	 * @return AccountTerm[] of account search terms
67
	 */
68
	public function findByAccountId($account_id) {
69
		$qb = $this->db->getQueryBuilder();
70
		$qb->select('term')
71
			->from($this->getTableName())
72
			->where($qb->expr()->eq('account_id', $qb->createNamedParameter($account_id)));
73
74
		return $this->findEntities($qb->getSQL(), $qb->getParameters());
75
	}
76
}

lib/private/User/AccountMapper.php 1 location

@@ 128-135 (lines=8) @@
125
	 * @throws MultipleObjectsReturnedException if more than one account exists
126
	 * @return Account
127
	 */
128
	public function getByUid($uid) {
129
		$qb = $this->db->getQueryBuilder();
130
		$qb->select('*')
131
			->from($this->getTableName())
132
			->where($qb->expr()->eq('lower_user_id', $qb->createNamedParameter(strtolower($uid))));
133
134
		return $this->findEntity($qb->getSQL(), $qb->getParameters());
135
	}
136
137
	/**
138
	 * @param string $fieldName

apps/dav/lib/CalDAV/CalDavBackend.php 1 location

@@ 1459-1465 (lines=7) @@
1456
	 * @param string $objectUri
1457
	 * @return void
1458
	 */
1459
	function deleteSchedulingObject($principalUri, $objectUri) {
1460
		$query = $this->db->getQueryBuilder();
1461
		$query->delete('schedulingobjects')
1462
				->where($query->expr()->eq('principaluri', $query->createNamedParameter($principalUri)))
1463
				->andWhere($query->expr()->eq('uri', $query->createNamedParameter($objectUri)))
1464
				->execute();
1465
	}
1466
1467
	/**
1468
	 * Creates a new scheduling object. This should land in a users' inbox.