Code Duplication    Length = 9-10 lines in 6 locations

lib/Db/SharesRequestBuilder.php 1 location

@@ 41-50 (lines=10) @@
38
	 *
39
	 * @return IQueryBuilder
40
	 */
41
	protected function getSharesDeleteSql() {
42
		$qb = $this->dbConnection->getQueryBuilder();
43
		$qb->delete(self::TABLE_FILE_SHARES);
44
		$qb->where(
45
			$qb->expr()
46
			   ->eq('share_type', $qb->createNamedParameter(self::SHARE_TYPE))
47
		);
48
49
		return $qb;
50
	}
51
52
53
	/**

lib/Db/SharingFrameRequestBuilder.php 1 location

@@ 107-116 (lines=10) @@
104
	 *
105
	 * @return IQueryBuilder
106
	 */
107
	protected function getSharesUpdateSql($uniqueId) {
108
		$qb = $this->dbConnection->getQueryBuilder();
109
		$qb->update(self::TABLE_SHARES)
110
		   ->where(
111
			   $qb->expr()
112
				  ->eq('unique_id', $qb->createNamedParameter((string)$uniqueId))
113
		   );
114
115
		return $qb;
116
	}
117
118
119
	/**

lib/Db/CircleProviderRequestBuilder.php 2 locations

@@ 508-516 (lines=9) @@
505
	 *
506
	 * @return IQueryBuilder
507
	 */
508
	protected function getBaseDeleteSql() {
509
		$qb = $this->dbConnection->getQueryBuilder();
510
		$expr = $qb->expr();
511
512
		$qb->delete('share')
513
		   ->where($expr->eq('share_type', $qb->createNamedParameter(IShare::TYPE_CIRCLE)));
514
515
		return $qb;
516
	}
517
518
519
	/**
@@ 524-532 (lines=9) @@
521
	 *
522
	 * @return IQueryBuilder
523
	 */
524
	protected function getBaseUpdateSql() {
525
		$qb = $this->dbConnection->getQueryBuilder();
526
		$expr = $qb->expr();
527
528
		$qb->update('share')
529
		   ->where($expr->eq('share_type', $qb->createNamedParameter(IShare::TYPE_CIRCLE)));
530
531
		return $qb;
532
	}
533
}
534

lib/Db/CirclesRequestBuilder.php 2 locations

@@ 326-335 (lines=10) @@
323
	 *
324
	 * @return IQueryBuilder
325
	 */
326
	protected function getCirclesUpdateSql($uniqueId) {
327
		$qb = $this->dbConnection->getQueryBuilder();
328
		$qb->update(self::TABLE_CIRCLES)
329
		   ->where(
330
			   $qb->expr()
331
				  ->eq('unique_id', $qb->createNamedParameter($uniqueId))
332
		   );
333
334
		return $qb;
335
	}
336
337
338
	/**
@@ 345-354 (lines=10) @@
342
	 *
343
	 * @return IQueryBuilder
344
	 */
345
	protected function getCirclesDeleteSql($circleUniqueId) {
346
		$qb = $this->dbConnection->getQueryBuilder();
347
		$qb->delete(self::TABLE_CIRCLES)
348
		   ->where(
349
			   $qb->expr()
350
				  ->eq('unique_id', $qb->createNamedParameter($circleUniqueId))
351
		   );
352
353
		return $qb;
354
	}
355
356
357
	/**