Code Duplication    Length = 15-15 lines in 2 locations

lib/Db/CircleProviderRequestBuilder.php 2 locations

@@ 69-83 (lines=15) @@
66
	 * @param IQueryBuilder $qb
67
	 * @param array $circleUniqueIds
68
	 */
69
	protected function limitToCircles(IQueryBuilder &$qb, $circleUniqueIds) {
70
71
		if (!is_array($circleUniqueIds)) {
72
			$circleUniqueIds = array($circleUniqueIds);
73
		}
74
75
		$expr = $qb->expr();
76
		$pf = ($qb->getType() === QueryBuilder::SELECT) ? 's.' : '';
77
		$qb->andWhere(
78
			$expr->in(
79
				$pf . 'share_with',
80
				$qb->createNamedParameter($circleUniqueIds, IQueryBuilder::PARAM_STR_ARRAY)
81
			)
82
		);
83
	}
84
85
86
	/**
@@ 158-172 (lines=15) @@
155
	 * @param IQueryBuilder $qb
156
	 * @param $files
157
	 */
158
	protected function limitToFiles(IQueryBuilder &$qb, $files) {
159
160
		if (!is_array($files)) {
161
			$files = array($files);
162
		}
163
164
		$expr = $qb->expr();
165
		$pf = ($qb->getType() === QueryBuilder::SELECT) ? 's.' : '';
166
		$qb->andWhere(
167
			$expr->in(
168
				$pf . 'file_source',
169
				$qb->createNamedParameter($files, IQueryBuilder::PARAM_INT_ARRAY)
170
			)
171
		);
172
	}
173
174
175
	/**