diff options
-rw-r--r-- | lib/Api/v1/Circles.php | 5 | ||||
-rw-r--r-- | lib/Db/CirclesRequest.php | 6 | ||||
-rw-r--r-- | lib/Service/CirclesService.php | 9 |
3 files changed, 12 insertions, 8 deletions
diff --git a/lib/Api/v1/Circles.php b/lib/Api/v1/Circles.php index e5df11ed..1d59ff35 100644 --- a/lib/Api/v1/Circles.php +++ b/lib/Api/v1/Circles.php @@ -239,15 +239,16 @@ class Circles { * return as well. * * @param string $circleUniqueId + * @param bool $forceAll * * @return Circle * @throws QueryException */ - public static function detailsCircle($circleUniqueId) { + public static function detailsCircle($circleUniqueId, $forceAll = false) { $c = self::getContainer(); return $c->query(CirclesService::class) - ->detailsCircle($circleUniqueId); + ->detailsCircle($circleUniqueId, $forceAll); } diff --git a/lib/Db/CirclesRequest.php b/lib/Db/CirclesRequest.php index aef18f98..aec55578 100644 --- a/lib/Db/CirclesRequest.php +++ b/lib/Db/CirclesRequest.php @@ -170,11 +170,13 @@ class CirclesRequest extends CirclesRequestBuilder { * * @param string $circleUniqueId * @param string $viewerId + * @param bool $forceAll * * @return Circle * @throws CircleDoesNotExistException + * @throws ConfigNoCircleAvailableException */ - public function getCircle($circleUniqueId, $viewerId) { + public function getCircle($circleUniqueId, $viewerId, $forceAll = false) { $qb = $this->getCirclesSelectSql(); $this->limitToShortenUniqueId($qb, $circleUniqueId, Circle::SHORT_UNIQUE_ID_LENGTH); @@ -183,7 +185,7 @@ class CirclesRequest extends CirclesRequestBuilder { $this->leftJoinOwner($qb); $this->leftJoinNCGroupAndUser($qb, $viewerId, '`c`.`unique_id`'); - $this->limitRegardingCircleType($qb, $viewerId, $circleUniqueId, Circle::CIRCLES_ALL, ''); + $this->limitRegardingCircleType($qb, $viewerId, $circleUniqueId, Circle::CIRCLES_ALL, '', $forceAll); $cursor = $qb->execute(); $data = $cursor->fetch(); diff --git a/lib/Service/CirclesService.php b/lib/Service/CirclesService.php index b87a63b5..d7693aa9 100644 --- a/lib/Service/CirclesService.php +++ b/lib/Service/CirclesService.php @@ -210,14 +210,15 @@ class CirclesService { * returns details on circle and its members if this->userId is a member itself. * * @param string $circleUniqueId + * @param bool $forceAll * * @return Circle - * @throws \Exception + * @throws Exception */ - public function detailsCircle($circleUniqueId) { + public function detailsCircle($circleUniqueId, $forceAll = false) { try { - $circle = $this->circlesRequest->getCircle($circleUniqueId, $this->userId); + $circle = $this->circlesRequest->getCircle($circleUniqueId, $this->userId, $forceAll); if ($this->viewerIsAdmin() || $circle->getHigherViewer() ->isLevel(Member::LEVEL_MEMBER) @@ -570,7 +571,7 @@ class CirclesService { $limit = $this->configService->getAppValue(ConfigService::CIRCLES_MEMBERS_LIMIT); } - if (sizeof($members) >= $limit) { + if (sizeof($members) >= $limit) { throw new MembersLimitException( 'This circle already reach its limit on the number of members' ); |