Code Duplication    Length = 24-25 lines in 2 locations

lib/Db/CircleProviderRequest.php 1 location

@@ 44-67 (lines=24) @@
41
	 *
42
	 * @return array
43
	 */
44
	public function getFilesForCircles($userId, $circleUniqueIds, $limit, $offset) {
45
46
		$qb = $this->getCompleteSelectSql();
47
		$this->linkToFileCache($qb, $userId);
48
		$this->limitToPage($qb, $limit, $offset);
49
		$this->limitToCircles($qb, $circleUniqueIds);
50
51
		$this->linkToMember($qb, $userId, $this->configService->isLinkedGroupsAllowed());
52
53
		$this->leftJoinShareInitiator($qb);
54
		
55
		$cursor = $qb->execute();
56
57
		$object_ids = [];
58
		while ($data = $cursor->fetch()) {
59
			self::editShareFromParentEntry($data);
60
			if (self::isAccessibleResult($data)) {
61
				$object_ids[] = $data['file_source'];
62
			}
63
		}
64
		$cursor->closeCursor();
65
66
		return $object_ids;
67
	}
68
69
70
	/**

lib/ShareByCircleProvider.php 1 location

@@ 459-483 (lines=25) @@
456
	 *
457
	 * @return IShare[]
458
	 */
459
	private function getSharedWithCircleMembers($userId, $shareType, $node, $limit, $offset) {
460
461
		$qb = $this->getCompleteSelectSql();
462
		$this->linkToFileCache($qb, $userId);
463
		$this->limitToPage($qb, $limit, $offset);
464
465
		if ($node !== null) {
466
			$this->limitToFiles($qb, [$node->getId()]);
467
		}
468
469
		$this->linkToMember($qb, $userId, $this->configService->isLinkedGroupsAllowed());
470
471
		$cursor = $qb->execute();
472
473
		$shares = [];
474
		while ($data = $cursor->fetch()) {
475
			self::editShareFromParentEntry($data);
476
			if (self::isAccessibleResult($data)) {
477
				$shares[] = $this->createShareObject($data);
478
			}
479
		}
480
		$cursor->closeCursor();
481
482
		return $shares;
483
	}
484
485
486
	/**