| @@ 42-65 (lines=24) @@ | ||
| 39 | * |
|
| 40 | * @return array |
|
| 41 | */ |
|
| 42 | public function getFilesForCircles($userId, $circleUniqueIds, $limit, $offset) { |
|
| 43 | ||
| 44 | $qb = $this->getCompleteSelectSql(); |
|
| 45 | $this->linkToFileCache($qb, $userId); |
|
| 46 | $this->limitToPage($qb, $limit, $offset); |
|
| 47 | $this->limitToCircles($qb, $circleUniqueIds); |
|
| 48 | ||
| 49 | $this->linkToMember($qb, $userId, $this->configService->isLinkedGroupsAllowed()); |
|
| 50 | ||
| 51 | $this->leftJoinShareInitiator($qb); |
|
| 52 | ||
| 53 | $cursor = $qb->execute(); |
|
| 54 | ||
| 55 | $object_ids = []; |
|
| 56 | while ($data = $cursor->fetch()) { |
|
| 57 | self::editShareFromParentEntry($data); |
|
| 58 | if (self::isAccessibleResult($data)) { |
|
| 59 | $object_ids[] = $data['file_source']; |
|
| 60 | } |
|
| 61 | } |
|
| 62 | $cursor->closeCursor(); |
|
| 63 | ||
| 64 | return $object_ids; |
|
| 65 | } |
|
| 66 | ||
| 67 | ||
| 68 | /** |
|
| @@ 467-491 (lines=25) @@ | ||
| 464 | * |
|
| 465 | * @return IShare[] |
|
| 466 | */ |
|
| 467 | private function getSharedWithCircleMembers($userId, $shareType, $node, $limit, $offset) { |
|
| 468 | ||
| 469 | $qb = $this->getCompleteSelectSql(); |
|
| 470 | $this->linkToFileCache($qb, $userId); |
|
| 471 | $this->limitToPage($qb, $limit, $offset); |
|
| 472 | ||
| 473 | if ($node !== null) { |
|
| 474 | $this->limitToFiles($qb, [$node->getId()]); |
|
| 475 | } |
|
| 476 | ||
| 477 | $this->linkToMember($qb, $userId, $this->configService->isLinkedGroupsAllowed()); |
|
| 478 | ||
| 479 | $cursor = $qb->execute(); |
|
| 480 | ||
| 481 | $shares = []; |
|
| 482 | while ($data = $cursor->fetch()) { |
|
| 483 | self::editShareFromParentEntry($data); |
|
| 484 | if (self::isAccessibleResult($data)) { |
|
| 485 | $shares[] = $this->createShareObject($data); |
|
| 486 | } |
|
| 487 | } |
|
| 488 | $cursor->closeCursor(); |
|
| 489 | ||
| 490 | return $shares; |
|
| 491 | } |
|
| 492 | ||
| 493 | ||
| 494 | /** |
|